From: Ian Jackson Date: Sun, 30 Dec 2007 15:40:23 +0000 (+0000) Subject: SGT's model X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=moebius2.git;a=commitdiff_plain;h=79a8db502c53f3fe497267466ead8f47f7b65b45 SGT's model --- diff --git a/sgtatham/z.max b/sgtatham/z.max new file mode 100644 index 0000000..fda7363 --- /dev/null +++ b/sgtatham/z.max @@ -0,0 +1,64 @@ +/* -*- c -*- +maxima -b z.max | perl -pe 's/\\\n//sg' | tail -1 | perl -pe 'BEGIN{print "set urange [0:1]\nset vrange [0:pi]\nset parametric\nset hidden\nset isosamples 30\nsplot "} s/^.*\[(.*)\].*$/$1/; s/%pi/pi/g; s:\^:**:g' | gnuplot -persist +*/ + +/* + * Construct a series of transformations which turn the unit + * circle in the x-y plane into something which might plausibly + * form the edge of an ordinary embedding of a Mobius strip. Each + * transformation must a homeomorphism of R^3, and hence in + * particular invertible. + * + * The individual transformations are as follows: + * + * - f applies a twist about the x-axis, by rotating the plane + * x=k by an amount proportional to k, for all k in R. The + * twist is set up so that the x=1 end of the unit circle + * remains where it started, and the x=-1 end is in the same + * place but rotated 180 degrees so that it's heading in the + * opposite direction. + * + * - g is a squash in the z-direction, squishing the twisted + * circle down into something that's closer to a flat + * figure-eight. + * + * - h elevates the two extreme-x ends of the circle in the z + * direction. + * + * So what we do is to take a unit circle; apply those + * transformations in order to make it an ordinary Mobius-strip + * edge; now construct an actual Mobius strip as the union of all + * straight line segments connecting pairs of points on that + * transformed circle which were originally 180 degrees apart; + * then apply the inverse homeomorphism to restore the edge to + * circularity. + * + * (We rely on the fact that our transformations have mangled the + * unit circle into a state in which none of those line segments + * intersect each other. Otherwise we'd end up with a + * self-intersecting surface.) + */ +f(x,y,z) := [x, y*sin(%pi*x/2) + z*cos(%pi*x/2), -y*cos(%pi*x/2) + z*sin(%pi*x/2)]; +g(x,y,z) := [x, y, z/1.5]; +h(x,y,z) := [x, y, z+x^2]; + +finv(x,y,z) := [x, y*sin(%pi*x/2) - z*cos(%pi*x/2), y*cos(%pi*x/2) + z*sin(%pi*x/2)]; +ginv(x,y,z) := [x, y, z*1.5]; +hinv(x,y,z) := [x, y, z-x^2]; + +fv(v) := f(v[1],v[2],v[3]); +gv(v) := g(v[1],v[2],v[3]); +hv(v) := h(v[1],v[2],v[3]); + +finvv(v) := finv(v[1],v[2],v[3]); +ginvv(v) := ginv(v[1],v[2],v[3]); +hinvv(v) := hinv(v[1],v[2],v[3]); + +hgf(v) := hv(gv(fv(v))); +fghinv(v) := finvv(ginvv(hinvv(v))); + +circle(t) := [cos(t), sin(t), 0]; + +ms(t,u) := fghinv(u*hgf(circle(t)) + (1-u)*hgf(-circle(t))); + +string(ms(v,u)); diff --git a/sgtatham/z.typescript b/sgtatham/z.typescript new file mode 100644 index 0000000..920cd72 --- /dev/null +++ b/sgtatham/z.typescript @@ -0,0 +1,8 @@ +: stormhawk;(B maxima -b z.max | perl -pe 's/\\\n//sg' | tail -1 | perl -pe 'BEGIN {print "set urange [0:1]\nset vrange [0:pi]\nset parametric\nset hidden\nset iso samples 30\nsplot "} s/^.*\[(.*)\].*$/$1/; s/%pi/pi/g; s:\^:**:g' +set urange [0:1] +set vrange [0:pi] +set parametric +set hidden +set isosamples 30 +splot u*cos(v)-(1-u)*cos(v),(u*sin(v)*sin(pi*cos(v)/2)+(1-u)*sin(v)*sin(pi*cos(v)/2))*sin(pi*(u*cos(v)-(1-u)*cos(v))/2)-1.5*((1-u)*(0.66666666666667*sin(v)*cos(pi*cos(v)/2)+cos(v)**2)+u*(cos(v)**2-0.66666666666667*sin(v)*cos(pi*cos(v)/2))-(u*cos(v)-(1-u)*cos(v))**2)*cos(pi*(u*cos(v)-(1-u)*cos(v))/2),1.5*((1-u)*(0.66666666666667*sin(v)*cos(pi*cos(v)/2)+cos(v)**2)+u*(cos(v)**2-0.66666666666667*sin(v)*cos(pi*cos(v)/2))-(u*cos(v)-(1-u)*cos(v))**2)*sin(pi*(u*cos(v)-(1-u)*cos(v))/2)+(u*sin(v)*sin(pi*cos(v)/2)+(1-u)*sin(v)*sin(pi*cos(v)/2))*cos(pi*(u*cos(v)-(1-u)*cos(v))/2) +: stormhawk;(B exit