X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=moebius.git;a=blobdiff_plain;f=moebius.cc;h=148ce0c3da9c34772abc28d1a1a59f0d685438dd;hp=d68f4aff8174426088f4f7c9972a60268ac4fecf;hb=5095d1eeeeff39305ec3b60d4134ff4929eaabca;hpb=1ddaa7bdf04344661fa4d9339ee85f49cbbf3ad9 diff --git a/moebius.cc b/moebius.cc index d68f4af..148ce0c 100644 --- a/moebius.cc +++ b/moebius.cc @@ -9,7 +9,7 @@ #include "moebius.hh" Point MoebiusStrip::edgepoint(double t) { - double theta= (t-0.5)*4.0*PI; + double theta= (t-0.5)*4.0*M_PI; double r= 1.0 - halfgap*(1.0 - sin(theta/2.0)); return Point(r*sin(theta), -r*cos(theta), @@ -47,7 +47,7 @@ void Bezier::debug() { // The second end is oriented towards [0,-1,0] Point MoebiusEnfoldment::edgepoint(double t) { - double theta= t*2.0*PI; + double theta= t*2.0*M_PI; return Point(sin(theta),cos(theta),0); } @@ -58,13 +58,13 @@ Point MoebiusEnfoldment::middlepoint(double t, double u) { double sizehere= sqrt(1-t*t); return Point((u*2.0-1.0) * sizehere, t, - sizehere * thickness * sin(u*2.0*PI)); + sizehere * thickness * sin(u*2.0*M_PI)); } else { t /= bottomportion; - double theta= (.5-u)*2*PI; - Bezier bx(sin(theta*.5), -theta/PI, 0, 0); + double theta= (.5-u)*2*M_PI; + Bezier bx(sin(theta*.5), -theta/M_PI, 0, 0); double ypushiness= (1-cos(theta))*2.5+1; -// double fudge= (PI*sin(theta*.5)*cos(theta*.5))*(.5-u)*(.5-u)*4; +// double fudge= (M_PI*sin(theta*.5)*cos(theta*.5))*(.5-u)*(.5-u)*4; double fudge= (.5-u)*(.5-u)*4*cos(theta*.5); Bezier by(-cos(theta*.5), 0, cos(theta)*ypushiness + fudge*ypushiness,