Heart Magic (幾何学アート)

 投稿者:yossyメール  投稿日:2009年 3月 7日(土)12時36分29秒
  以前、第1掲示板で掲載させていただいた動画プログラムの、簡略版です。アニメーションの結果の画像をその下に載せてあります。新しく開設した私のウェブサイトに、幾何学アートのプログラミング・データを置いていますので、よろしければぜひ一度覗いてみてください。

!Heart Magic(幾何学アート)
OPTION ANGLE DEGREES
DEF f(x)=x^2-x
DEF g(x)=-x^2-x
DEF h(x)=-x^2+1/2*x+1
DEF i(y)=y^2-y
DEF j(y)=y^2+1/2*y-1
DEF k(y)=y^2-1/2*y-1
DEF l(y)=-y^2+1/2*y+1
DIM M(4,4)
MAT READ M !図形の裏返し
DATA 0, 1, 0, 0
DATA 1, 0, 0, 0
DATA 0, 0, 1, 0
DATA 0, 0, 0, 1
SET WINDOW -9.2,9.2,-9.2,9.2
!集合
FOR n=6.9 TO 0 STEP -0.01
   SET DRAW mode hidden
   CLEAR
   DRAW pothos WITH M*ROTATE(180)*SHIFT(0,n)
   DRAW pothos WITH M*SHIFT(0,-n)
   DRAW pothos WITH M*ROTATE(90)*SHIFT(n,0)
   DRAW pothos WITH M*ROTATE(270)*SHIFT(-n,0)
   DRAW pothos WITH SHIFT(n,-n)
   DRAW pothos WITH ROTATE(180)*SHIFT(-n,n)
   DRAW pothos WITH ROTATE(90)*SHIFT(n,n)
   DRAW pothos WITH ROTATE(270)*SHIFT(-n,-n)
   WAIT DELAY 0.01
   SET DRAW mode explicit
NEXT n
WAIT DELAY 8
!発散
FOR n=0 TO 6.9 STEP 0.01
   SET DRAW mode hidden
   CLEAR
   DRAW heart1 WITH SHIFT(-n,n)
   DRAW heart1 WITH ROTATE(180)*SHIFT(-n/3,n)
   DRAW heart1 WITH M*SHIFT(n/3,n)
   DRAW heart1 WITH ROTATE(90)*SHIFT(n,n)
   DRAW heart2 WITH SHIFT(-n,n/3)
   DRAW heart2 WITH ROTATE(180)*SHIFT(-n/3,n/3)
   DRAW heart2 WITH ROTATE(90)*SHIFT(n/3,n/3)
   DRAW heart2 WITH ROTATE(270)*SHIFT(n,n/3)
   DRAW heart3 WITH SHIFT(-n,-n/3)
   DRAW heart3 WITH ROTATE(180)*SHIFT(-n/3,-n/3)
   DRAW heart3 WITH ROTATE(90)*SHIFT(n/3,-n/3)
   DRAW heart3 WITH ROTATE(270)*SHIFT(n,-n/3)
   DRAW heart3 WITH M*ROTATE(180)*SHIFT(-n,-n)
   DRAW heart3 WITH M*SHIFT(-n/3,-n)
   DRAW heart3 WITH M*ROTATE(90)*SHIFT(n/3,-n)
   DRAW heart3 WITH M*ROTATE(270)*SHIFT(n,-n)
   WAIT DELAY 0.01
   SET DRAW mode explicit
NEXT n
PICTURE heart1
   FOR x=-1 TO 1 STEP 0.01
      PLOT LINES: x,f(ABS(x));
   NEXT x
   FOR y=0 TO (1+SQR(17))/4 STEP 0.01
      PLOT LINES: l(y),y;
   NEXT y
   FOR y=(1+SQR(17))/4 TO 0 STEP -0.01
      PLOT LINES: k(y),y;
   NEXT y
END PICTURE
PICTURE heart2
   FOR x=-1 TO 0 STEP 0.01
      PLOT LINES: x,g(x);
   NEXT x
   FOR y=0 TO 1 STEP 0.01
      PLOT LINES: i(y),y;
   NEXT y
   FOR x=0 TO 2 STEP 0.01
      PLOT LINES: x,h(x);
   NEXT x
   FOR y=-2 TO 0 STEP 0.01
      PLOT LINES: j(y),y;
   NEXT y
END PICTURE
PICTURE heart3
   FOR y=-2 TO 1 STEP 0.01
      PLOT LINES: -f(ABS(y)),y;
   NEXT y
   FOR x=-1/4 TO -9/4 STEP -0.01
      PLOT LINES: x+1/4,SGN(x)*f(ABS(x))+13/16;
   NEXT x
END PICTURE
PICTURE pothos
   FOR y=-2 TO 1 STEP 0.01
      PLOT LINES: -f(ABS(y)),y;
   NEXT y
   FOR x=-1/4 TO -9/4 STEP -0.01
      PLOT LINES: x+1/4,SGN(x)*f(ABS(x))+13/16;
   NEXT x
   FOR x=-2 TO 2 STEP 0.01
      PLOT LINES: x,SGN(x)*f(ABS(x));
   NEXT x
END PICTURE
END

http://www15.plala.or.jp/pothos/

 

戻る