# include # include # include # include using namespace std; # include "dislin.H" int main ( int argc, char *argv[] ); //****************************************************************************** int main ( int argc, char *argv[] ) //****************************************************************************** // // Purpose: // // MAIN demonstrates the use of the interpolation options when using CURVE. // // Modified: // // 02 September 2005 // { static char *cpol[6] = { "SPLINE", "STEM", "BARS", "STAIRS", "STEP", "LINEAR" }; static char *ctit = "Interpolation Methods"; int i; int nx; int ny; int nya = 2700; static float x[] = { 0.0, 1.0, 3.0, 4.5, 6.0, 8.0, 9.0, 11.0, 12.0, 12.5, 13.0, 15.0, 16.0, 17.0, 19.0, 20.0 }; static float y[] = { 2.0, 4.0, 4.5, 3.0, 1.0, 7.0, 2.0, 3.0, 5.0, 2.0, 2.5, 2.0, 4.0, 6.0, 5.5, 4.0 }; cout << "\n"; cout << "DISLIN_EX04:\n"; cout << " Demonstrate the use of the various interpolation options\n"; cout << " when using CURVE to plot (X,Y) data.\n"; // // Specify the format of the output file. // metafl ( "PNG" ); // // Specify the name of the output graphics file. // setfil ( "dislin_ex04.png" ); setpag ( "da4p" ); disini ( ); complx ( ); pagera ( ); incmrk ( 1 ); hsymbl ( 25 ); titlin ( ctit, 1 ); axslen ( 1500, 350 ); setgrf ( "line", "line", "line", "line" ); for ( i = 0; i < 6; i++ ) { axspos ( 350, nya-i*350 ); polcrv ( cpol[i] ); marker ( 0 ); graf ( 0.0, 20.0, 0.0, 5.0, 0.0, 10.0, 0.0, 5.0 ); nx = nxposn ( 1.0 ); ny = nyposn ( 8.0 ); messag ( cpol[i], nx, ny ); curve ( x, y, 16 ); if ( i == 5 ) { height ( 50 ); title ( ); } endgrf ( ); } disfin ( ); cout << "\n"; cout << "DISLIN_EX04:\n"; cout << " Normal end of execution.\n"; return 0; }