/* spiral.c spiral trough */ #include "spiral.h" #include double spiral(double x, double y) { double halfpi = 1.57079; double r, theta, tz; r = sqrt(x*x+y*y); if( r < 0.001) theta = 0.0; else theta = atan2(y,x); tz = theta/halfpi; if(tz < 0.0) tz = tz + 4.0; return 0.75*r + sin((r+tz)*halfpi); } /* end of spiral */