package uk.co.flyingsquirrels.aero;
import flanagan.plot.PlotGraph;
public class AirfoilTableGraph {
private static final String AIRFOIL = "63018";
public static void main(String[] args) {
AirfoilTable table = new AirfoilTable(AIRFOIL);
int dataLength = table.getDataLength();
double[] alpha = table.getAlpha();
double[] cl = table.getCl();
double[] cd = table.getCd();
double[] cm = table.getCm();
double[][] data = new double[6][dataLength];
for (int i=0; i < dataLength; i++) {
data[0][i] = alpha[i];
data[1][i] = cl[i];
data[2][i] = alpha[i];
data[3][i] = cd[i];
data[4][i] = alpha[i];
data[5][i] = cm[i];
}
PlotGraph graph = new PlotGraph(data);
graph.setLine(3);
graph.setPoint(0);
graph.setXaxisLegend("Angle of attack");
graph.setYaxisLegend("Coefficient");
graph.setXaxisUnitsName("radians");
graph.setGraphTitle("cL, cD, cM for NACA " + AIRFOIL);
graph.plot();
}
}