進んだ例題

[ 貴方がDynagraph初心者であれば、 例題集から開始しても良い。 ]

この項では、曲線と曲面の方程式のコレクションを含む -- あるものはmundaneで、 あるものは遥かに興味深い -- これらはdynagraphを使って描けるものである。 大半のブラウザを使って、この項からマウスを使って命令を切り出し、 dynagraphの命令行に貼り付けると良い。

重要事項: 以下の幾つかの例題では任意の変数を導入 しており、不必要になった時点で、後に続く例題への影響を避ける為に、 これらは消去(未定義)にしなければならない。それらの下には # cleanup:タグで印を付けている。

標準的な放物面(a standard-issue paraboloid

    plot3d(x^2+y^2, x=-1..1, y=-1..1);
それと、双曲面
    plot3d(x^2-y^2, x=-1..1, y=-1..1);
上の二つを一緒に
    plot3d({x^2+y^2,x^2-y^2}, x=-1..1, y=-1..1);
円筒座標系での放物面
    plot3d(r^2, r=0..1, t=0..2*Pi, coords=z_cylindrical);
それと"逆放物面(inverse-paraboloid)"
    plot3d(z^2, t=0..2*Pi, z=0..1, coords=cylindrical);
トーラスと球面
    p := plot3d([(2+cos(t))*cos(s),(2+cos(t))*sin(s),sin(t)], t=-Pi/2..Pi/2,s=0..2*Pi,grid=[15,25]):
    q := plot3d([1.5*sin(t)*cos(s),1.5*sin(t)*sin(s),1+1.5*cos(t)], t=0..Pi/2,s=0..2*Pi):
    display([p,q]);
Cassini曲面:等高線は``Cassini oval''である。もし、d1*d2d1+d2で置換えると、等高線がellipseになる。
    d1 := sqrt((x-1)^2+y^2);
    d2 := sqrt((x+1)^2+y^2);
    plot3d(d1*d2,x=-2..2, y=-2..2,contours=60,style=patchcontour,view=0..2);

    # cleanup:
    d1 := d1; d2 := d2;
atan2のグラフ:
    plot(atan2(y,x)/Pi, x=-1..1,y=-1..1, grid=[50,50],contours=30,style=patchcontour);
零次のBessel関数
    plot(5*BesselJ(0,r), r=0..8.6, t=0..1.5*Pi, coords=z_cylindrical);
Vivianiの伽藍:球面と円筒の交差。レンダリングのアイデアは Tom Banchoffの http://alem3d.obidos.org/en/struik/viviani/commから得ている。
    R := 1:
    a := 1.2;
    sp := plot(R, s=0..2*Pi, t=0..Pi, coords=spherical, grid=[60,60],color=brown):
    cy := plot([R/2 + R/2*cos(t), R/2*sin(t), s], t=0..2*Pi, s=-a*R..a*R,grid=[50,50], color=MediumPurple4):
    tu := tubeplot([R/2 + R/2*cos(t), R/2*sin(t), R*sin(t/2)], t=0..4*Pi, tuberadius=R/30, color=gold3, tubepoints=10):
    display([sp,cy,tu], title=`Temple of Viviani\n[ http://alem3d.obidos.org/en/struik/viviani/comm ]`);
    R := R; a := a; sp := sp; cy := cy; tu := tu;

    # cleanup:
    x := x; y := y; z := z;
特異点の取扱い方: dynagraphは、特異点のある個所に穴を空けてこれを避ける。これは上のグラフを 見れば分る。
    plot3d(x^2*y/(x^4+y^2), x=-1..1, y=-1..1, style=patch);
デフォルトのgrid=[25,25]の代りにgrid=[24,24]を用いた 同じ関数は穴を持たない。何故なら、その原点は最早網目点ではないからで ある。
    plot3d(x^2*y/(x^4+y^2), x=-1..1, y=-1..1, style=patch, grid=[24,24]);
anatomy
    plot3d(t, t=-Pi..Pi, s=0..Pi, coords=spherical, shading=zgrayscale, title=anatomy);
torn球面
    plot3d(t, t=-Pi..Pi,s=-Pi/2..Pi/2, coords=spherical, title=`a torn sphere`);
貝殻1
    plot3d([x*sin(x)*cos(y), x*cos(x)*cos(y), x*sin(y)], x=0..2*Pi, y=0..Pi, title=`shell 1`);
貝殻 2
    plot3d((1.3)^x * sin(y), x=-1..2*Pi, y=0..Pi, coords=spherical, title=`shell 2`);
貝殻 3
    plot3d(theta, theta=0..3*Pi, phi=Pi/12..Pi-Pi/12, grid=[48,16], coords=spherical, title=`shell 3`);
貝殻 4 (Gnuplotデモより)
    plot3d([cos(u)*u*(1+cos(v)/2), sin(v)*u/2, sin(u)*u*(1+cos(v)/2)], u=0..2*Pi, v=0..2*Pi, title=`shell 4`);
円錐
    plot3d(z, theta=0..2*Pi, z=-5..5, coords=cylindrical);
複素平方根関数の実部
    plot3d(r^(1/2)*cos(t/2), r=0..1, t=0..4*Pi, grid=[10,50], coords=z_cylindrical, title=`Real part of the complex square root function`);
複素三重根関数の実部
    plot3d(r^(1/3)*cos(t/3), r=0..1, t=0..6*Pi, grid=[10,75], coords=z_cylindrical, title=`Real part of the complex cube root function`);
Enneperの曲面 (Gnuplotのデモから)
    plot3d([u -u^3/3 + u*v^2,v -v^3/3 + v*u^2,u^2 - v^2], u=-2..2, v=-2..2, title=`Enneper's surface`);
Kleinの壷:断面を見る為に、vの値域を0..1.5*Piに変更しよう。
    x := (2*sin(u)*cos(v/2)-sin(2*u)*sin(v/2)+8)*cos(v):
    y := (2*sin(u)*cos(v/2)-sin(2*u)*sin(v/2)+8)*sin(v):
    z := 4*sin(u)*sin(v/2)+sin(2*u)*cos(v/2):
    plot3d([x,y,z], u=0..2*Pi, v=0..2*Pi, grid=[20,40], title=`A Klein bottle`);

    # cleanup:
    x := x; y := y; z := z;
Mobiusの帯: wが帯の幅で、nが半捻りの個数である。 それらの値で試そう。
    w := 0.5;
    n := 1;
    r := 1 + v * cos(t*n/2);
    z :=     v * sin(t*n/2);
    plot3d([r,t,z], t=0..2*Pi, v=-w/2..w/2, grid=[100,3], coords=z_cylindrical);

    # cleanup:
    w:=w; n:=n; r:=r; z:=z;
pointy曲面:羃乗を除いてしまえば、通常の球面になってしまう事に注意せよ。
    plot3d([cos(v)^3*cos(u)^3, sin(v)^3*cos(u)^3, sin(u)^3], u=-Pi/2..Pi/2, v=0..2*Pi, title=`Sphere^3`);
interlocking tori (Gnuplotのデモより)
    p := plot3d([cos(u)+0.5*cos(u)*cos(v), sin(u)+0.5*sin(u)*cos(v), 0.5*sin(v)], u=0..2*Pi, v=0..2*Pi, grid=[25,12]):
    q := plot3d([1+cos(u)+.3*cos(u)*cos(v), 0.3*sin(v), sin(u)+0.3*sin(u)*cos(v)], u=0..2*Pi, v=0..2*Pi, grid=[25,12]):
    display([p,q]);
interlocking circles (Mapleの空間曲線のデモより)
    spacecurve({[sin(t),0,cos(t)],[cos(t)+1,sin(t),0]}, t=-Pi..Pi, thickness=5);
結び目 (Mapleの空間曲線のデモより)
    u := -10*cos(t) - 2*cos(5*t) + 15*sin(2*t);
    v := -15*cos(2*t) + 10*sin(t) - 2*sin(5*t); 
    w := 10*cos(3*t); 

    # plot as a spacecurve:
    spacecurve([u,v,w], t= 0..2*Pi);

    # plot as a tube:
    tubeplot([u,v,w], t= 0..2*Pi, tuberadius=4,tubepoints=20, numpoints=100);

    # cleanup:
    u := u; v := v; w := w;
コイル発条
    n := 4;
    R := 5;
    p0 := tubeplot([R*cos(t), R*sin(t), 0], t=0..2*Pi, numpoints=25);
    p1 := tubeplot([R*cos(t), R*sin(t), t], t=0..2*n*Pi, numpoints=25*n);
    p2 := tubeplot([R*cos(t), R*sin(t), 2*n*Pi], t=0..2*Pi, numpoints=25);
    display([p0,p1,p2], title=`a coil spring`);

    # cleanup:
    n := n; R := R;
トーラスに沿った三葉結び目: Alfred GrayのModern Differential Geometry of Curves and Surfaces のアイデアから。
    a := 4; b := 2; c := 2; p := 2; q := 3;
    knot := spacecurve([(a + b*cos(q*t))*cos(p*t), (a + b*cos(q*t))*sin(p*t), c*sin(q*t)], t=0..2*Pi,numpoints=100);
    tube := tubeplot([(a + b*cos(q*t))*cos(p*t), (a + b*cos(q*t))*sin(p*t), c*sin(q*t)], t=0..2*Pi,numpoints=100,tuberadius=0.5);
    torus := plot3d([ (a+b*cos(u))*cos(v), (a+b*cos(u))*sin(v), c*sin(u)], u=0..2*Pi, v=0..2*Pi,grid=[25,50]);
    display([torus,tube], title=`trefoil around a torus`);

    # cleanup:
    a := a; b := b; c := c; p := p; q := q; torus := torus; tube := tube; knot := knot;
SteinerのRoman曲面:Al Grayの本から(ibid)
    plot3d([sin(2*u)*cos(v)^2, sin(u)*sin(2*v), cos(u)*sin(2*v)], u=0..Pi, v=0..Pi, title=`Steiner's Roman Surface`);
定負曲率のKuen曲面:Al Grayの本から(ibid)
    w := 1 + u^2*sin(v)^2;
    x := 2*(cos(u)+u*sin(u))*sin(v)/w;
    y := 2*(sin(u)-u*cos(u))*sin(v)/w; 
    z := log(tan(v/2)) + 2*cos(v)/w;
    plot3d([x,y,z], u=-4..4, v=0.05..Pi-0.05,title=`Kuen's surface of constant negative curvature`);

    # cleanup:
    x := x; y := y; z := z; w := w;
the stereographic ellipsoid:Al Grayの本から(ibid)
    d := 1+u^2+v^2;
    x := a*(1-u^2-v^2)/d;
    y := 2*b*u/d;
    z := 2*c*v/d;
    a := 1; b := 3; c := 5;
    plot3d([x,y,z], u=-2.8..2.8, v=-2.8..2.8, style=patch, title=`The stereographic ellipsoid`);

    # cleanup:
    a := a; b := b; c := c; d := d; x := x; y := y; z := z;
Whitneyの傘Al Grayの本より(ibid)
    plot3d([u*v, u, v^2], u=-1..1, v=-1..1, title=`The Whitney Umbrella`);
the cross capAl Grayの本から (ibid)
    x := sin(u) * sin(2*v) / 2;
    y := sin(2*u) * cos(v)^2;
    z := cos(2*u) * cos(v)^2;

    # the complete surface:
    plot([x,y,z], u=0..Pi, v=-Pi/2..Pi/2, title=`The cross cap`);

    # the sectioned surface:
    plot([x,y,z], u=0..Pi, v=-Pi/2..Pi/2, view=-1..0.5, title=`The cross cap split open`);

    # cleanup:
    x := x; y := y; z := z;
Diniの定負曲率曲面Al Grayの本から(ibid)
    x := cos(u) * sin(v);
    y := sin(u) * sin(v);
    z := cos(v) + log(tan(v/2)) + 0.2 * u;
    plot([x,y,z], u=0..4*Pi, v=0.1..Pi/2, grid=[50,20], title=`Dini's surface`);

    # cleanup:
    x := x; y := y; z := z;
螺旋の接曲面
    x := cos(t); y := sin(t); z := t;
    xp := -sin(t); yp := cos(t); zp := 1;
    plot3d([x + v*xp, y + v*yp, z + v*zp], t=0..2*Pi, v=-4..4);

    # cleanup:
    x := x; y := y; z := z; xp := xp; yp := yp; zp := zp;
Bour's Minimal Surface: see http://mathworld.wolfram.com/BoursMinimalSurface.html
    x := r*cos(t)-r^2*cos(2*t)/2;
    y := -r*sin(t)-r^2*sin(2*t)/2;
    z := (4/3)*r^(3/2)*cos(3*t/2);
    plot([x,y,z], t=0..4*Pi, r=1..4,grid=[100,10],style=patch);

    # cleanup:
    x := x; y := y; z := z;
Kleinの壷 Maple Gallery より。
    top := plot3d([(2.5 + 1.5*cos(v))*cos(u), (2.5 + 1.5*cos(v))*sin(u), -2.5 *sin(v)], u = 0.. 2* Pi, v = Pi .. 2*Pi);
    middle := plot3d([ (2.5 + 1.5*cos(v)) * cos(u),(2.5 + 1.5*cos(v)) * sin(u), 3*v - 6 * Pi ], u = 0.. 2* Pi, v = Pi .. 2*Pi);
    handle := plot3d( [ 2 - 2*cos(v) + sin(u), cos(u), 3 * v - 6 * Pi], u = 0..  2*Pi , v = Pi .. 2*Pi);
    bottom := plot3d( [2 + (2 + cos(u))*cos(v),sin(u), -3 * Pi +  (2 + cos(u)) * sin (v) ], u = 0.. 2* Pi, v = Pi .. 2*Pi);
    display([bottom, middle, handle, top]);

    # cleanup:
    top := top; middle := middle; handle := handle; bottom := bottom;
pumpkin:Maple Galleryより (ibid)
    plot3d(1+(1/3)*sin(2*theta)*sin(5*phi)^2, phi=0..2*Pi, theta=0..Pi, coords=spherical, grid=[60,60]);
helix:Maple Galleryより (ibid)
    plot3d(3+sin(5*theta+phi)^2, phi=0..2*Pi, theta=0..Pi, coords=spherical, grid=[60,60]);
clover:Maple Galleryより (ibid)
    plot3d(sin(2*theta+3*phi), phi=0..2*Pi, theta=0..Pi, coords=spherical, grid=[60,60]);
目次に戻る