説明が手抜きなのは,リンク先にある漸化式が若干謎な為です.
実際には下のようなソースで動きます.
- double xa=-4*x+Math.cos(m*w);
- double ya=-4*y+Math.sin(m*w);
- double r=Math.sqrt(xa*xa+ya*ya);
- w=Math.atan2(ya,xa);
- double x1,y1;
- if(mt.nextBoolean(0.5)){
- x1=-Math.cos(n*w)-Math.sqrt(r)*Math.cos(w/2)/2;
- y1=-Math.sin(n*w)+Math.sqrt(r)*Math.sin(w/2)/2;
- }else{
- x1=-Math.cos(n*w)+Math.sqrt(r)*Math.cos(w/2)/2;
- y1=-Math.sin(n*w)-Math.sqrt(r)*Math.sin(w/2)/2;
- }
- x=x1;
- y=y1;
例:
某氏より要望があった為,大きいサイズで.
m=1, n=1

Fig.1
回転させて,重ねると雪になります.

Fig.2
m=2, n=2

Fig.3
こちらは星.
折角なので壁紙サイズ.

Fig.4

Fig.5
参考文献
Paul Bourke.“Star Julia”.<http://local.wasp.uwa.edu.au/~pbourke/fractals/starjulia/>.Paul Bourke - Personal Pages.(参照2010年1月13日)
0 件のコメント:
コメントを投稿