Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
27
Task/Chaos-game/Gnuplot/chaos-game.gnuplot
Normal file
27
Task/Chaos-game/Gnuplot/chaos-game.gnuplot
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
## Chaos Game (Sierpinski triangle) 2/16/17 aev
|
||||
reset
|
||||
fn="ChGS3Gnu1"; clr='"red"';
|
||||
ttl="Chaos Game (Sierpinski triangle)"
|
||||
sz=600; sz1=sz/2; sz2=sz1*sqrt(3);
|
||||
x=y=xf=yf=v=0;
|
||||
dfn=fn.".dat"; ofn=fn.".png";
|
||||
set terminal png font arial 12 size 640,640
|
||||
set print dfn append
|
||||
set output ofn
|
||||
unset border; unset xtics; unset ytics; unset key;
|
||||
set size square
|
||||
set title ttl font "Arial:Bold,12"
|
||||
lim=30000; max=100; x=y=xw=yw=p=0;
|
||||
randgp(top) = floor(rand(0)*top)
|
||||
x=randgp(sz); y=randgp(sz2);
|
||||
do for [i=1:lim] {
|
||||
v=randgp(3);
|
||||
if (v==0) {x=x/2; y=y/2}
|
||||
if (v==1) {x=sz1+(sz1-x)/2; y=sz2-(sz2-y)/2}
|
||||
if (v==2) {x=sz-(sz-x)/2; y=y/2}
|
||||
xf=floor(x); yf=floor(y);
|
||||
if(!(xf<1||xf>sz||yf<1||yf>sz)) {print xf," ",yf};
|
||||
}
|
||||
plot dfn using 1:2 with points pt 7 ps 0.5 lc @clr
|
||||
set output
|
||||
unset print
|
||||
Loading…
Add table
Add a link
Reference in a new issue