// an interesting tangent function for Feb 14 // #include #include #define N 101 // number of points #define PI (4*atan(1)) typedef struct { double x, y; } Point; Point f( double a) { double t = fabs(tan(a)), r = pow(t,1/t); Point p; p.x = r*cos(a); p.y = r*sin(a); return p; } int main( void) { // linear scale of N points from amin to amax // double amin = 0, amax = PI, da = (amax-amin)/(N-1), a; Point p; // int i = 0; while( i < N) { ...; ++i; } for( int i = 0; i < N; ++i) // i = 0, 1, ..., N-1 { a = amin + i*da; p = f(a); printf( "%g %g\n", p.x, p.y); } return 0; }