Default { ; #index = 0.01 * #numiter default: title = "(None)" } BubblesV2 { ;Mini tutorial ; This is a fractal tree algorithm where spheres ('Bubbles') grow on a central base sphere. ; If spheres end up inside another sphere, then only the bigger sphere is drawn.Intersecting spheres are drawn ; in a geometrically correct fashion.. ; It is written as a UCL, and is intended be used with the Pixel formula. ; Parameters: ; Iteration levels : the number of branchings of the tree. Be careful, calculation times get very long above 10 or so. ; Bubble multiplier: the number of branches: eg input 3 puts 3 new spheres on every sphere already drawn. ; Bubble angle auto? : if checked, the new spheres are divided evenly on the old sphere, if unchecked one can choose ; the angles at which the new spheres grow. ; Bubble Offset Auto? : (only visible if Bubble angle auto is checked) if unchecked you can choose an offset angle ; for the even distribution of the new spheres. If checked, the standard offset is 90 degrees. ; Radius reduction: factor at which spheres in subsequent generation shrink. eg input 0.5 makes spheres in the ; next generation half as big as the parent. ;Distance reduction: input 1 makes the new spheres tangent to the old sphere, inut<1 puts the new spheres ; partially inside the old sphere. ;Color the bubbles?: if unchecked, then just the outline of the spheres is drawn. ;Plane rotation angle: this performs a rotation around a vertical axis down the middle of the image, for a 3D effect. ; #Bubble colors: use a gradient with equally spaced color bands. This parameter is the number of bands used. ; eg if the gradient is divided in 8 equally spaced color bands,and you want to see only the first 2, the input should be 2. ;# Color bands in gradient : in above example this input should be 8. ; Light source?: if unchecked, the spheres are colored with a flat color. If checked, a color gradation is used if ; present in the gradient. Light Angle and Light elevation allow to alter this gradation. ;Line thickness: (limited to 0.05), the line used to draw the outline of the spheres. ; Line color: if eg#Color bands=8, then the first color is 0, the second 1, and the rightmost is 7.. ; With thanks to Jos Boogen for testing.. global: $define DEBUG float max=(@nb^(@it+1)-1)/(@nb-1) print ("max= ",max) COMPLEX i= (0,1) int bl =200 int count[41250] complex pp[30000] float r[30000] float drx[30000] complex ppp[30000] float rrrr[30000] int taggg[30000] r[0]=@rad int tagg[30000] int tag[30000] int VC[41250,700] pp[0]=0 int vak1[203,203] int mm=0 int a=0 int t=0 ; int n=0 int q=0 int j=0 int u=0 int rr=0 int im=0 int rra=0 int ima=0 float angle[13] angle[1]=@angle1*#pi/180 angle[2]=@angle2*#pi/180 angle[3]=@angle3*#pi/180 angle[4]=@angle4*#pi/180 angle[5]=@angle5*#pi/180 angle[6]=@angle6*#pi/180 angle[7]=@angle7*#pi/180 angle[8]=@angle8*#pi/180 angle[9]=@angle9*#pi/180 angle[10]=@angle10*#pi/180 angle[11]=@angle11*#pi/180 angle[12]=@angle12*#pi/180 float offset=0 int level=1 if @boffset offset=90*#pi/180 else offset=@offset*#pi/180 endif if @bangle while level <@nb+1 angle[level]=(level-1)*#pi*2/@nb+offset level=level+1 endwhile endif ;------------------------------------------------------ int fl=0 int temp=0 float dhx=@dhx*#pi/180 float ratio=#height/#width if ratio<.75 float sx=1.5/#magn/ratio float sy=1.5/#magn else float sx=2/#magn float sy=2*ratio/#magn endif float eps=0.0 if sx<=sy eps=2*sx/#width else eps=2*sy/#height endif float d=@d*sx/2 int u=0 int lev[@it+1] complex P =0 float Rad=@rad float hoek=0.0 complex PV =0 float RV=1.0 float hoekV=0.0 print("rad=",rad) ;----------------------------------------------VANAF HIER DE LOOP j=1 while j>0 while j<@it+1 lev[j]=lev[j]+1 P=P+(Rad+@rd*Rad)*@dd*exp(i*(hoek+angle[lev[j]])) Rad=@rd*Rad hoek=hoek+angle[lev[j]]-#pi/2 if hoek<0 hoek=hoek+2*#pi endif if hoek>2*#pi hoek=hoek-2*#pi endif if abs(cabs(P-#center)-Rad)=tag[u]) ; gooi t eruit als binnen cirkel u, als identiek met u (enkel als t latere generatie is) t=t-1 u=t+1 fl=1 endif u=u+1 endwhile if fl==0 u=0 while u=tag[t]) ; gooi u eruit als binnen cirkel t,als identiek met t(enkel als u latere generatie is) pp[u]=1E20 r[u]=0 endif u=u+1 endwhile endif ;-- tot hier check op identieke cirkels j=j+1 endwhile ;print("j=",j) j=j-1 hoekV=hoek-angle[lev[j]]+#pi/2 if hoekV<0 hoekV=hoekV+2*#pi endif ;print("hoekV=",hoekV*180/#pi) RV=Rad/@rd ;print("RV=",RV) PV=P-(RV+@rd*RV)*@dd*exp(i*(hoekV+angle[lev[j]])) ;print("PV=",PV) lev[j]=lev[j]+1 while lev[j]<@nb+1 P=PV+(RV+@rd*RV)*@dd*exp(i*(hoekV+angle[lev[j]])) Rad=@rd*RV hoek=hoekV+angle[lev[j]]-#pi/2 if hoek<0 hoek=hoek+2*#pi endif if hoek>2*#pi hoek=hoek-2*#pi endif lev[j]=lev[j]+1 if abs(cabs(P-#center)-Rad)=tag[u]) ; gooi t eruit als binnen cirkel u, als identiek met u (enkel als t latere generatie is) t=t-1 u=t+1 fl=1 endif u=u+1 endwhile if fl==0 u=0 while u=tag[t]) ; gooi u eruit als binnen cirkel t,als identiek met t(enkel als u latere generatie is) pp[u]=1E20 r[u]=0 endif u=u+1 endwhile endif ;-- tot hier check op identieke cirkels endif endwhile ; voor lev(j] lev[j]=lev[j]-1 hoek=hoek-angle[lev[j]]+#pi/2 if hoek<0 hoek=hoek+2*#pi endif if hoek>2*#pi hoek=hoek-2*#pi endif Rad=Rad/@rd P=P-(Rad+@rd*Rad)*@dd*exp(i*(hoek+angle[lev[j]])) lev[j]=0 j=j-1 while lev[j]>@nb-1 hoek=hoek-angle[lev[j]]+#pi/2 if hoek<0 hoek=hoek+2*#pi endif if hoek>2*#pi hoek=hoek-2*#pi endif Rad=Rad/@rd P=P-(Rad+@rd*Rad)*@dd*exp(i*(hoek+angle[lev[j]])) lev[j]=0 j=j-1 endwhile hoek=hoek-angle[lev[j]]+#pi/2 if hoek<0 hoek=hoek+2*#pi endif if hoek>2*#pi hoek=hoek-2*#pi endif Rad=Rad/@rd P=P-(Rad+@rd*Rad)*@dd*exp(i*(hoek+angle[lev[j]])) endwhile j=-1 u=0 while u1 && @bangle==false) endparam param angle3 Caption = "Bubble Angle #3" Default =90.0 Max=360.0 Visible=( @nb>2 && @bangle==false) endparam param angle4 Caption = "Bubble Angle #4" Default =135.0 Max=360.0 Visible= (@nb>3 && @bangle==false) endparam param angle5 Caption = "Bubble Angle #5" Default =180.0 Max=360.0 Visible=( @nb>4 && @bangle==false) endparam param angle6 Caption = "Bubble Angle #6" Default =225.0 Max=360.0 Visible= (@nb>5 && @bangle==false) endparam param angle7 Caption = "Bubble Angle #7" Default =270.0 Max=360.0 Visible=( @nb>6 && @bangle==false) endparam param angle8 Caption = "Bubble Angle #8" Default =315.0 Max=360.0 Visible= (@nb>7 && @bangle==false) endparam param angle9 Caption = "Bubble Angle #9" Default =0.0 Max=360.0 Visible= (@nb>8 && @bangle==false) endparam param angle10 Caption = "Bubble Angle #10" Default =0.0 Max=360.0 Visible= (@nb>9 && @bangle==false) endparam param angle11 Caption = "Bubble Angle #11" Default =0.0 Max=360.0 Visible= (@nb>10 && @bangle==false) endparam param angle12 Caption = "Bubble Angle #12" Default =0.0 Max=360.0 Visible= (@nb>11 && @bangle==false) endparam param rd Caption = "Radius reduction" Default = 0.7 ; Max=1.0 endparam param dd Caption = "Distance reduction" Default = 0.4 ; Max=1.0 endparam param vk Caption = "Color the bubbles?" Default = TRUE endparam ; param vd ; Caption = "Rotate plane?" ; Default = True ; endparam param dhx Caption = "Plane rotation angle?" Default =30.0 endparam int param nrc Caption = "# Bubble Colors?" Default = 8 endparam param ls Caption = "Light source?" Default = TRUE endparam param lsang Caption = "Light angle?" Default = 90.0 visible=(@ls==true ) endparam param lselev Caption = "Light elev (0-1)?" Default = 0.6 visible=(@ls==true ) endparam param d Caption = "Line thickness" Default = 0.05 max=.05 endparam param clrlijn Caption = "Line color" Default = 6.0 endparam param nc Caption = " #Col. bands in gradient" Default = 8 endparam } Backdrops (BOTH) { ; Jos Leys January 2003 ; use with a color gradient evenly divided in color bands ; tell the UCL how many color bands you used with the "Number of colors" parameter ; you can then choose the line colors ( zero color means leftmost color band ) global: $define debug complex i= (0.0,1.0) float d= @d float dikte=@dikte init: float clr [20] clr[1]=@clrlijn1 clr[2]=@clrlijn2 clr[3]=@clrlijn3 clr[4]=@clrlijn4 complex hh=0 int cnt=0 bool ev=TRUE bool evx=TRUE bool evy=TRUE complex zz1=0 complex zz2=0 complex test1=0 float test2=0 float test3=0 float c=0 float r=0 float h=0 float xt=0.0 float yt=0.0 float x=0.0 float y=0.0 int xx=0 int yy=0 z=#z xx=floor(real(z)/d) yy=floor(imag(z)/d) x=(real(z)-xx*d)/d y=(imag(z)-yy*d)/d zz=x+i*y if (xx+yy)%2 ==0 ev = TRUE else ev=FALSE endif INT ff[5] loop: final: IF xx%2==0 evx=TRUE else evx=FALSE endif IF yy%2==0 evy=TRUE else evy=FALSE endif ;------------------------------------------ if @var==0 if ev zz1=.5,zz2=.5+i test1 = (zz-zz2)/(zz1-zz2) test2 = imag(test1)*sqrt(|zz1-zz2|) IF abs(test2)< dikte c=clr[1]+(dikte-test2)*.5/dikte endif zz1=.5*i,zz2=1+i*.5 test1 = (zz-zz2)/(zz1-zz2) test2 = imag(test1)*sqrt(|zz1-zz2|) IF abs(test2)< dikte c=clr[2]+(dikte-test2)*.5/dikte endif else ; oneven blokjes zz1=.5*i,zz2=1+i*.5 test1 = (zz-zz2)/(zz1-zz2) test2 = imag(test1)*sqrt(|zz1-zz2|) IF abs(test2)< dikte c=clr[2]+(dikte-test2)*.5/dikte endif zz1=.5,zz2=.5+i test1 = (zz-zz2)/(zz1-zz2) test2 = imag(test1)*sqrt(|zz1-zz2|) IF abs(test2)< dikte c=clr[1]+(dikte-test2)*.5/dikte endif endif ; voor ev endif ; voor @var ;------------------------------------------ if @var==1 if !evx && !evy clr[1]=@clrlijn3 clr[2]=@clrlijn4 clr[3]=@clrlijn1 clr[4]=@clrlijn2 endif if evx && !evy clr[1]=@clrlijn4 clr[2]=@clrlijn3 clr[3]=@clrlijn2 clr[4]=@clrlijn1 endif if evx && evy clr[1]=@clrlijn1 clr[2]=@clrlijn2 clr[3]=@clrlijn3 clr[4]=@clrlijn4 endif if !evx && evy clr[1]=@clrlijn2 clr[2]=@clrlijn1 clr[3]=@clrlijn4 clr[4]=@clrlijn3 endif cnt=1 while cnt<5 if cnt==1 hh=0 elseif cnt==2 hh=1 elseif cnt==3 hh=1+i elseif cnt==4 hh=i endif test2=dikte/2-abs(cabs(zz-hh)-(1-dikte/2)) if test2>0 c=clr[cnt]+test2/dikte endif cnt=cnt+1 endwhile endif ; voor @var ;------------------------------------------ if @var==2 if !evx && !evy clr[1]=@clrlijn1 clr[2]=@clrlijn2 clr[3]=@clrlijn3 clr[4]=@clrlijn4 ff[1]=1 ff[2]=2 ff[3]=3 ff[4]=4 endif if evx && !evy clr[1]=@clrlijn2 clr[2]=@clrlijn4 clr[3]=@clrlijn3 clr[4]=@clrlijn1 ff[1]=2 ff[2]=3 ff[3]=4 ff[4]=1 endif if evx && evy clr[1]=@clrlijn4 clr[2]=@clrlijn2 clr[3]=@clrlijn1 clr[4]=@clrlijn3 ff[1]=3 ff[2]=1 ff[3]=2 ff[4]=4 endif if !evx && evy clr[1]=@clrlijn3 clr[2]=@clrlijn4 clr[3]=@clrlijn1 clr[4]=@clrlijn2 ff[1]=3 ff[2]=4 ff[3]=2 ff[4]=1 endif cnt=1 while cnt<5 f=0 if cnt==1 f=1 elseif cnt==2 f=1 elseif cnt==3 f=1 elseif cnt==4 f=1 endif if ff[cnt]==1 xt=x yt=y elseif ff[cnt]==2 xt=1-x yt=y elseif ff[cnt]==3 xt=y yt=1-x elseif ff[cnt]==3 xt=1-y yt=1-x elseif ff[cnt]==4 xt=1-y yt=1-x endif zp=xt+i*yt if f==1 c1=(0.75*sqrt(2)-1)/(sqrt(2)-1) c2=1-c1+i r=0.25/(sqrt(2)-1) if atan2(zp-c1)>=0 && atan2(zp-c1)<=#pi/4 test3=sqrt(|zp-c1|)-r+dikte/2 if test3>0 && test3=#pi && h<=5*#pi/4 test3=sqrt(|zp-c2|)-r+dikte/2 if test3>0 && test3#pi/4 && h>5*#pi/4 pt1=(0.75,0.25) pt2=(0.25,0.75) test1 = (zp-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif endif endif ; voor f cnt=cnt+1 endwhile endif ; voor var=2 ;------------------------------------- if @var==3 if !evx && !evy clr[1]=@clrlijn1 clr[2]=@clrlijn2 clr[3]=@clrlijn3 clr[4]=@clrlijn4 ff[1]=1 ff[2]=3 ff[3]=3 ff[4]=3 endif if evx && !evy clr[1]=@clrlijn4 clr[2]=@clrlijn4 clr[3]=@clrlijn4 clr[4]=@clrlijn2 ff[1]=4 ff[2]=4 ff[3]=4 ff[4]=2 endif if evx && evy clr[1]=@clrlijn2 clr[2]=@clrlijn3 clr[3]=@clrlijn3 clr[4]=@clrlijn3 ff[1]=1 ff[2]=3 ff[3]=3 ff[4]=3 endif if !evx && evy clr[1]=@clrlijn3 clr[2]=@clrlijn3 clr[3]=@clrlijn3 clr[4]=@clrlijn1 ff[1]=4 ff[2]=4 ff[3]=4 ff[4]=2 endif cnt=1 while cnt<5 f=0 if cnt==1 f=1 elseif cnt==2 f=1 elseif cnt==3 f=1 elseif cnt==4 f=1 endif if ff[cnt]==1 xt=x yt=y elseif ff[cnt]==2 xt=1-x yt=y elseif ff[cnt]==3 xt=y yt=1-x elseif ff[cnt]==3 xt=1-y yt=1-x elseif ff[cnt]==4 xt=1-y yt=1-x endif zp=xt+i*yt if f==1 c1=(0.75*sqrt(2)-1)/(sqrt(2)-1) c2=1-c1+i r=0.25/(sqrt(2)-1) if atan2(zp-c1)>=0 && atan2(zp-c1)<=#pi/4 test3=sqrt(|zp-c1|)-r+dikte/2 if test3>0 && test3=#pi && h<=5*#pi/4 test3=sqrt(|zp-c2|)-r+dikte/2 if test3>0 && test3#pi/4 && h>5*#pi/4 pt1=(0.75,0.25) pt2=(0.25,0.75) test1 = (zp-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif endif endif ; voor f cnt=cnt+1 endwhile endif ; voor var=3 ;------------------------------------- if @var==4 if !evx && !evy clr[1]=@clrlijn1 clr[2]=@clrlijn2 clr[3]=@clrlijn3 clr[4]=@clrlijn4 ff[1]=1 ff[2]=3 ff[3]=3 ff[4]=3 endif if evx && !evy clr[1]=@clrlijn4 clr[2]=@clrlijn4 clr[3]=@clrlijn4 clr[4]=@clrlijn2 ff[1]=4 ff[2]=4 ff[3]=4 ff[4]=2 endif if evx && evy clr[1]=@clrlijn2 clr[2]=@clrlijn3 clr[3]=@clrlijn3 clr[4]=@clrlijn3 ff[1]=1 ff[2]=3 ff[3]=3 ff[4]=3 endif if !evx && evy clr[1]=@clrlijn3 clr[2]=@clrlijn3 clr[3]=@clrlijn3 clr[4]=@clrlijn1 ff[1]=4 ff[2]=4 ff[3]=4 ff[4]=2 endif cnt=1 while cnt<5 f=0 if cnt==1 f=1 elseif cnt==2 f=1 elseif cnt==3 f=1 elseif cnt==4 f=1 endif if ff[cnt]==1 xt=x yt=y elseif ff[cnt]==2 xt=1-x yt=y elseif ff[cnt]==3 xt=y yt=1-x elseif ff[cnt]==3 xt=1-y yt=1-x elseif ff[cnt]==4 xt=1-y yt=1-x endif zp=xt+i*yt if f==1 pt1=(0.75,0.0) pt2=(0.25,1.0) test1 = (zp-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif endif ; voor f cnt=cnt+1 endwhile endif ; voor var=4 ;------------------------------------- if @var==5 if !evx && !evy clr[1]=@clrlijn1 clr[2]=@clrlijn2 clr[3]=@clrlijn3 clr[4]=@clrlijn4 ff[1]=1 ff[2]=3 ff[3]=3 ff[4]=3 endif if evx && !evy clr[1]=@clrlijn4 clr[2]=@clrlijn4 clr[3]=@clrlijn4 clr[4]=@clrlijn2 ff[1]=4 ff[2]=4 ff[3]=4 ff[4]=2 endif if evx && evy clr[1]=@clrlijn2 clr[2]=@clrlijn3 clr[3]=@clrlijn3 clr[4]=@clrlijn3 ff[1]=1 ff[2]=3 ff[3]=3 ff[4]=3 endif if !evx && evy clr[1]=@clrlijn3 clr[2]=@clrlijn3 clr[3]=@clrlijn3 clr[4]=@clrlijn1 ff[1]=4 ff[2]=4 ff[3]=4 ff[4]=2 endif cnt=1 while cnt<5 f=0 if cnt==1 f=1 elseif cnt==2 f=1 elseif cnt==3 f=1 elseif cnt==4 f=1 endif if ff[cnt]==1 xt=x yt=y elseif ff[cnt]==2 xt=1-x yt=y elseif ff[cnt]==3 xt=y yt=1-x elseif ff[cnt]==4 xt=1-y yt=1-x endif zp=xt+i*yt if f==1 c1=0.75 c2=1-c1+i h=atan2(zp-c2) if h<0 h=h+2*#pi endif if atan2(zp-c1)>=3*#pi/4 && atan2(zp-c1)<=#pi pt1=(0.25,0.0) pt2=(0.25,1.0) test1 = (zp-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif elseif h>=7*#pi/4 && h<=2*#pi pt1=(0.75,0.0) pt2=(0.75,1.0) test1 = (zp-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif else pt1=(0.0,0.5) pt2=(1.0,0.5) test1 = (zp-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif endif endif ; voor f cnt=cnt+1 endwhile endif ; voor var=5 ;------------------------------------- if @var==6 if !evx && !evy clr[1]=@clrlijn1 clr[2]=@clrlijn2 ff[1]=1 ff[2]=4 endif if evx && !evy clr[1]=@clrlijn1 clr[2]=@clrlijn2 ff[1]=2 ff[2]=5 endif if evx && evy clr[1]=@clrlijn2 clr[2]=@clrlijn1 ff[1]=1 ff[2]=4 endif if !evx && evy clr[1]=@clrlijn1 clr[2]=@clrlijn2 ff[1]=5 ff[2]=2 endif cnt=1 while cnt<3 f=0 if cnt==1 f=1 elseif cnt==2 f=1 endif if ff[cnt]==1 xt=x yt=y elseif ff[cnt]==2 xt=1-x yt=y elseif ff[cnt]==3 xt=y yt=1-x elseif ff[cnt]==4 xt=1-y yt=1-x elseif ff[cnt]==5 xt=x yt=1-y endif zp=xt+i*yt if f==1 c1=0.0 c2=1-c1+i h=atan2(zp-c2) if h<0 h=h+2*#pi endif if atan2(zp-c1)>=#pi/4 pt1=(0.0,0.75) pt2=(1.0,0.75) test1 = (zp-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif elseif atan2(zp-c1)<=#pi/4 && c==0 pt1=(0.75,0.0) pt2=(0.75,1.0) test1 = (zp-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif endif endif ; voor f cnt=cnt+1 endwhile endif ; voor var=6 ;------------------------------------- if @var==7 if evy clr[1]=@clrlijn1 clr[2]=@clrlijn2 else clr[1]=@clrlijn2 clr[2]=@clrlijn1 endif c1=.5+i*.25 h=atan2(zz-c1) if h<0 h=h+2*#pi endif c2=.5+i*.5 h2=atan2(zz-c2) if h2<0 h2=h2+2*#pi endif c3=.5+i*3/8 h3=atan2(zz-c3) if h3<0 h3=h3+2*#pi endif cnt=1 if h>5*#pi/4 && h<7*#pi/4 pt1=3/8, pt2=3/8+i test1 = (zz-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif pt1=5/8, pt2=5/8+i test1 = (zz-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif elseif h2>5*#pi/4 && h2<7*#pi/4 pt1=i/8, pt2=1+i/8 test1 = (zz-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif endif if h2>#pi/4 && h2<3*#pi/4 pt1=i*7/8, pt2=1+i*7/8 test1 = (zz-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif endif if h3>#pi/4 && h3<3*#pi/4 pt1=3/8, pt2=3/8+i test1 = (zz-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt+1]+(dikte-test2)/dikte+-.5 endif pt1=5/8, pt2=5/8+i test1 = (zz-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt+1]+(dikte-test2)/dikte+-.5 endif else pt1=.5*i, pt2=1+.5*i test1 = (zz-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt+1]+(dikte-test2)/dikte+-.5 endif endif if h2>3*#pi/4 && h2<5*#pi/4 pt1=1/8, pt2=1/8+i test1 = (zz-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif elseIF h2>7*#pi/4 || h2<#pi/4 pt1=7/8, pt2=7/8+i test1 = (zz-pt1)/(pt2-pt1) test2 = imag(test1)*sqrt(|pt1-pt2|) IF abs(test2)< dikte/2 c=clr[cnt]+(dikte-test2)/dikte+-.5 endif endif endif ;------------------------------------- #index = c/@n IF c == 0 IF @sol #solid = true ENDIF ENDIF default: title = "Backdrops" param d caption = "Grid size" default = .1 endparam param var caption = "Variation" enum= "Trellice" "Circles" "Weave" "Weave2""Weave3""Weave4""Frames" "Interlocked" default = 0 endparam param dikte Caption = "Line thickness" Default = 0.25 endparam param n caption="Number of colors" default= 8 endparam param clrlijn1 caption="Color line1" default= 0.0 endparam param clrlijn2 caption="Color line2" default= 1.0 endparam param clrlijn3 caption="Color line3" default= 2.0 visible = @var==1 || @var==2 || @var==3|| @var==4 || @var==5 endparam param clrlijn4 caption="Color line4" default= 3.0 visible = @var==1 || @var==2 || @var==3|| @var==4 || @var==5 endparam param sol caption="Solid background?" default= TRUE endparam } BubblesV1 { ;Mini tutorial ; This is a fractal tree algorithm where spheres ('Bubbles') grow on a central base sphere. ; If spheres end up inside another sphere, then only the bigger sphere is drawn.Intersecting spheres are drawn ; in a geometrically correct fashion.. ; It is written as a UCL, and is intended be used with the Pixel formula. ; Parameters: ; Iteration levels : the number of branchings of the tree. Be careful, calculation times get very long above 10 or so. ; Bubble multiplier: the number of branches: eg input 3 puts 3 new spheres on every sphere already drawn. ; Bubble angle auto? : if checked, the new spheres are divided evenly on the old sphere, if unchecked one can choose ; the angles at which the new spheres grow. ; Bubble Offset Auto? : (only visible if Bubble angle auto is checked) if unchecked you can choose an offset angle ; for the even distribution of the new spheres. If checked, the standard offset is 90 degrees. ; Radius reduction: factor at which spheres in subsequent generation shrink. eg input 0.5 makes spheres in the ; next generation half as big as the parent. ;Distance reduction: input 1 makes the new spheres tangent to the old sphere, inut<1 puts the new spheres ; partially inside the old sphere. ;Color the bubbles?: if unchecked, then just the outline of the spheres is drawn. ;Plane rotation angle: this performs a rotation around a vertical axis down the middle of the image, for a 3D effect. ; #Bubble colors: use a gradient with equally spaced color bands. This parameter is the number of bands used. ; eg if the gradient is divided in 8 equally spaced color bands,and you want to see only the first 2, the input should be 2. ;# Color bands in gradient : in above example this input should be 8. ; Light source?: if unchecked, the spheres are colored with a flat color. If checked, a color gradation is used if ; present in the gradient. Light Angle and Light elevation allow to alter this gradation. ;Line thickness: (limited to 0.05), the line used to draw the outline of the spheres. ; Line color: if eg#Color bands=8, then the first color is 0, the second 1, and the rightmost is 7.. ; With thanks to Jos Boogen for testing.. global: ; $define DEBUG float max=(@nb^(@it+1)-1)/(@nb-1) print ("max= ",max) COMPLEX i= (0,1) int bl =200 int count[41250] complex pp[30000] float r[30000] float drx[30000] complex ppp[30000] float rrrr[30000] int taggg[30000] r[0]=1 int tagg[30000] int tag[30000] int VC[41250,700] pp[0]=0 int vak1[203,203] int mm=0 int a=0 int t=0 ; int n=0 int q=0 int j=0 int u=0 int rr=0 int im=0 int rra=0 int ima=0 float angle[13] angle[1]=@angle1*#pi/180 angle[2]=@angle2*#pi/180 angle[3]=@angle3*#pi/180 angle[4]=@angle4*#pi/180 angle[5]=@angle5*#pi/180 angle[6]=@angle6*#pi/180 angle[7]=@angle7*#pi/180 angle[8]=@angle8*#pi/180 angle[9]=@angle9*#pi/180 angle[10]=@angle10*#pi/180 angle[11]=@angle11*#pi/180 angle[12]=@angle12*#pi/180 float offset=0 int level=1 if @boffset offset=90*#pi/180 else offset=@offset*#pi/180 endif if @bangle while level <@nb+1 angle[level]=(level-1)*#pi*2/@nb+offset level=level+1 endwhile endif ;------------------------------------------------------ int fl=0 int temp=0 float dhx=@dhx*#pi/180 float ratio=#height/#width if ratio<.75 float sx=1.5/#magn/ratio float sy=1.5/#magn else float sx=2/#magn float sy=2*ratio/#magn endif float eps=0.0 if sx<=sy eps=2*sx/#width else eps=2*sy/#height endif float d=@d*sx/2 int u=0 int lev[@it+1] complex P =0 float Rad=1.0 float hoek=0.0 complex PV =0 float RV=1.0 float hoekV=0.0 ;----------------------------------------------VANAF HIER DE LOOP j=1 while j>0 while j<@it+1 lev[j]=lev[j]+1 P=P+(Rad+@rd*Rad)*@dd*exp(i*(hoek+angle[lev[j]])) Rad=@rd*Rad hoek=hoek+angle[lev[j]]-#pi/2 if hoek<0 hoek=hoek+2*#pi endif if hoek>2*#pi hoek=hoek-2*#pi endif if abs(cabs(P-#center)-Rad)=tag[u]) ; gooi t eruit als binnen cirkel u, als identiek met u (enkel als t latere generatie is) t=t-1 u=t+1 fl=1 endif u=u+1 endwhile if fl==0 u=0 while u=tag[t]) ; gooi u eruit als binnen cirkel t,als identiek met t(enkel als u latere generatie is) pp[u]=1E20 r[u]=0 endif u=u+1 endwhile endif ;-- tot hier check op identieke cirkels j=j+1 endwhile ;print("j=",j) j=j-1 hoekV=hoek-angle[lev[j]]+#pi/2 if hoekV<0 hoekV=hoekV+2*#pi endif ;print("hoekV=",hoekV*180/#pi) RV=Rad/@rd ;print("RV=",RV) PV=P-(RV+@rd*RV)*@dd*exp(i*(hoekV+angle[lev[j]])) ;print("PV=",PV) lev[j]=lev[j]+1 while lev[j]<@nb+1 P=PV+(RV+@rd*RV)*@dd*exp(i*(hoekV+angle[lev[j]])) Rad=@rd*RV hoek=hoekV+angle[lev[j]]-#pi/2 if hoek<0 hoek=hoek+2*#pi endif if hoek>2*#pi hoek=hoek-2*#pi endif lev[j]=lev[j]+1 if abs(cabs(P-#center)-Rad)=tag[u]) ; gooi t eruit als binnen cirkel u, als identiek met u (enkel als t latere generatie is) t=t-1 u=t+1 fl=1 endif u=u+1 endwhile if fl==0 u=0 while u=tag[t]) ; gooi u eruit als binnen cirkel t,als identiek met t(enkel als u latere generatie is) pp[u]=1E20 r[u]=0 endif u=u+1 endwhile endif ;-- tot hier check op identieke cirkels endif endwhile ; voor lev(j] lev[j]=lev[j]-1 hoek=hoek-angle[lev[j]]+#pi/2 if hoek<0 hoek=hoek+2*#pi endif if hoek>2*#pi hoek=hoek-2*#pi endif Rad=Rad/@rd P=P-(Rad+@rd*Rad)*@dd*exp(i*(hoek+angle[lev[j]])) lev[j]=0 j=j-1 while lev[j]>@nb-1 hoek=hoek-angle[lev[j]]+#pi/2 if hoek<0 hoek=hoek+2*#pi endif if hoek>2*#pi hoek=hoek-2*#pi endif Rad=Rad/@rd P=P-(Rad+@rd*Rad)*@dd*exp(i*(hoek+angle[lev[j]])) lev[j]=0 j=j-1 endwhile hoek=hoek-angle[lev[j]]+#pi/2 if hoek<0 hoek=hoek+2*#pi endif if hoek>2*#pi hoek=hoek-2*#pi endif Rad=Rad/@rd P=P-(Rad+@rd*Rad)*@dd*exp(i*(hoek+angle[lev[j]])) endwhile j=-1 u=0 while u1 && @bangle==false) endparam param angle3 Caption = "Bubble Angle #3" Default =90.0 Max=360.0 Visible=( @nb>2 && @bangle==false) endparam param angle4 Caption = "Bubble Angle #4" Default =135.0 Max=360.0 Visible= (@nb>3 && @bangle==false) endparam param angle5 Caption = "Bubble Angle #5" Default =180.0 Max=360.0 Visible=( @nb>4 && @bangle==false) endparam param angle6 Caption = "Bubble Angle #6" Default =225.0 Max=360.0 Visible= (@nb>5 && @bangle==false) endparam param angle7 Caption = "Bubble Angle #7" Default =270.0 Max=360.0 Visible=( @nb>6 && @bangle==false) endparam param angle8 Caption = "Bubble Angle #8" Default =315.0 Max=360.0 Visible= (@nb>7 && @bangle==false) endparam param angle9 Caption = "Bubble Angle #9" Default =0.0 Max=360.0 Visible= (@nb>8 && @bangle==false) endparam param angle10 Caption = "Bubble Angle #10" Default =0.0 Max=360.0 Visible= (@nb>9 && @bangle==false) endparam param angle11 Caption = "Bubble Angle #11" Default =0.0 Max=360.0 Visible= (@nb>10 && @bangle==false) endparam param angle12 Caption = "Bubble Angle #12" Default =0.0 Max=360.0 Visible= (@nb>11 && @bangle==false) endparam param rd Caption = "Radius reduction" Default = 0.7 ; Max=1.0 endparam param dd Caption = "Distance reduction" Default = 0.4 ; Max=1.0 endparam param vk Caption = "Color the bubbles?" Default = TRUE endparam ; param vd ; Caption = "Rotate plane?" ; Default = True ; endparam param dhx Caption = "Plane rotation angle?" Default =30.0 endparam int param nrc Caption = "# Bubble Colors?" Default = 8 endparam param ls Caption = "Light source?" Default = TRUE endparam param lsang Caption = "Light angle?" Default = 90.0 visible=(@ls==true&& @vk==true ) endparam param lselev Caption = "Light elev (0-1)?" Default = 0.6 visible=(@ls==true && @vk==true) endparam param d Caption = "Line thickness" Default = 0.05 max=.05 endparam param clrlijn Caption = "Line color" Default = 6.0 endparam param nc Caption = " #Col. bands in gradient" Default = 8 endparam } CelticKnot (BOTH) { ;Jos Leys August 2002 ; Updated January 2003 ; Changes: ; 1.Row codes do not need to begin with a decimal point anymore ; Codes starting with a decimal point are still allowed for backward compatibility ; with existing UPR's ; 2.The current version does not need "Extended" precision setting, which tended to ; slow down calculations. It now uses the basic "Double" precision. ; ; Mini-tutorial: ; Based on Andy Sloss' method ( see http://www.celticknot.org/tutorials/p_sloss01.php ) ; use with 'Pixel" formula, or others if you are adventurous ;Parameters: ; # columns: column 1 is leftmost ; # rows : row 1 is at the bottom ; for square shape: have one more row than columns ; (Optional:row codes start with a decimal point) ; The number of digits equal to number of columns ; for more than 1O columns, give data in both "Code row n" and "Code row n>10". ; Maximum number of columns: 20 ; Maximum number of rows: 21 ; valid digits: ; 1 --> vertical lines ; 2 --> diagonal lines ; 3 --> horizontal lines ; 4 --> vertical lines at edge ; 5 --> diagonal lines at edge ; 6 --> horizontal lines at edge ; Values >3 only have effect in two consecutive rows in the same column. ; top and bottom row can only contain either 3 or 6 ; first digit in a row code should be either zero or >3 ; note that a row where there is no drawing in the leftmost grids can start with digits>6 ; so 7003336 or 9003336 is equivalent to 0.0003336 if the decimal point is used ; last digit in a row code should be >3 ; "Show grid" : show reference points on rows/columns ( helpful for larger images) ; "Solid background" : allows choosing background ; see also: http://www.josleys.com/Celtic.xls for some examples (MS Excel file) global: ; $define DEBUG ; Nbna= trunc(log(@N6)/log(10))+1 ; print("Nbna ",Nbna) init: complex i= (0.0,1.0) float d=@d int f= 0 int ff= 0 float n = 1.0 float c = 0.0 complex test1=0.0 float test2 = 0.0 float test3 = 0.0 float Na= 0.0 float Nb= 0.0 float Na1= 0.0 float Nb1= 0.0 int Nan= 0 int Nbn= 0 int Na1n= 0 int Nb1n= 0 int rij= @rij-1 float x= 0.0 float y= 0.0 float xt= 0.0 float yt= 0.0 int xx= 0 int yy= 0 int xp= 0 int xm= 0 int T1=0 int T2=0 int T3=0 int T4=0 int T1m=0 int T3m=0 int T2p=0 int T4p=0 float r= 0.0 float h= 0.0 complex c1 = (0.0,0.0) complex c2 = (0.0,0.0) complex pt1 = (0.0,0.0) complex pt2 = (0.0,0.0) complex zp = (0.0,0.0) complex q=0 float c= 0.0 INT iter=1 int s=0 loop: final: ; ;print("#numiter=",#numiter) s= #numiter if #numiter==0 s=1 endif ; print ("s=",s) iter=1 while iter0 $endif endparam param N1 caption = "Code row 2" default = 525. $ifdef VER30 visible=@rij >1 $endif endparam param N2 caption = "Code row 3" default = 525. $ifdef VER30 visible=@rij >2 $endif endparam param N3 caption = "Code row 4" default = 636. $ifdef VER30 visible=@rij >3 $endif endparam param N4 caption = "Code row 5" default = 0.0 $ifdef VER30 visible=@rij >4 $endif endparam param N5 caption = "Code row 6" default = 0.0 $ifdef VER30 visible=@rij >5 $endif endparam param N6 caption = "Code row 7" default = 0.0 $ifdef VER30 visible=@rij >6 $endif endparam param N7 caption = "Code row 8" default = 0.0 $ifdef VER30 visible=@rij >7 $endif endparam param N8 caption = "Code row 9" default = 0.0 $ifdef VER30 visible=@rij >8 $endif endparam param N9 caption = "Code row 10" default = 0.0 $ifdef VER30 visible=@rij >9 $endif endparam param N10 caption = "Code row 11" default = 0.0 $ifdef VER30 visible=@rij >10 $endif endparam param N11 caption = "Code row 12" default = 0.0 $ifdef VER30 visible=@rij >11 $endif endparam param N12 caption = "Code row 13" default = 0.0 $ifdef VER30 visible=@rij >12 $endif endparam param N13 caption = "Code row 14" default = 0.0 $ifdef VER30 visible=@rij >13 $endif endparam param N14 caption = "Code row 15" default = 0.0 $ifdef VER30 visible=@rij >14 $endif endparam param N15 caption = "Code row 16" default = 0.0 $ifdef VER30 visible=@rij >15 $endif endparam param N16 caption = "Code row 17" default = 0.0 $ifdef VER30 visible=@rij >16 $endif endparam param N17 caption = "Code row 18" default = 0.0 $ifdef VER30 visible=@rij >17 $endif endparam param N18 caption = "Code row 19" default = 0.0 $ifdef VER30 visible=@rij >18 $endif endparam param N19 caption = "Code row 20" default = 0.0 $ifdef VER30 visible=@rij >19 $endif endparam param N20 caption = "Code row 21" default = 0.0 $ifdef VER30 visible=@rij >20 $endif endparam param N01 caption = "Code row 1 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >0) $endif endparam param N11X caption = "Code row 2 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >1) $endif endparam param N21 caption = "Code row 3 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >2) $endif endparam param N31 caption = "Code row 4 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >3) $endif endparam param N41 caption = "Code row 5 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >4) $endif endparam param N51 caption = "Code row 6 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >5) $endif endparam param N61 caption = "Code row 7 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >6) $endif endparam param N71 caption = "Code row 8 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >7) $endif endparam param N81 caption = "Code row 9 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >8) $endif endparam param N91 caption = "Code row 10 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >9) $endif endparam param N101 caption = "Code row 11 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >10) $endif endparam param N111 caption = "Code row 12 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >11) $endif endparam param N121 caption = "Code row 13 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >12) $endif endparam param N131 caption = "Code row 14 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >13) $endif endparam param N141 caption = "Code row 15 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >14) $endif endparam param N151 caption = "Code row 16 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >15) $endif endparam param N161 caption = "Code row 17 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >16) $endif endparam param N171 caption = "Code row 18 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >17) $endif endparam param N181 caption = "Code row 19 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >18) $endif endparam param N191 caption = "Code row 20 >10" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >19) $endif endparam param N201 caption = "Code 21-2" default = 0.0 $ifdef VER30 visible=(@kol>10 && @rij >20) $endif endparam param ptn caption="Show grid?" default= False endparam param sol caption="Solid background?" default= TRUE endparam } Frames-Jos { ; Use with frame transform in raf.uxf ; $define debug global: float ratio=#height/#width if ratio<.75 float sx=1.5/#magn/ratio float sy=1.5/#magn else float sx=2/#magn float sy=2*ratio/#magn endif complex pr[@row+3,3] complex pc[@col+3,3] complex i= (0,1) int j=1 ; rijen berekenen while j<@row+2 pr[j,1]=#center-sx+i*(sy-2*sy*(j-1)/@row) pr[j,2]=#center+sx+i*(sy-2*sy*(j-1)/@row) print(" j=",j) print(" pr[j,1]=",pr[j,1]) print(" pr[j,2]=",pr[j,2]) j=j+1 endwhile j=1 ; kolommen berekenen while j<@col+2 pc[j,1]=#center-sx+2*sx*(j-1)/@col+i*(sy) pc[j,2]=#center-sx+2*sx*(j-1)/@col-i*(sy) print(" j=",j) print(" pc[j,1]=",pc[j,1]) print(" pc[j,2]=",pc[j,2]) j=j+1 endwhile init: float d = @dikte float test = 0.0 float c= 0.0 complex test1=0 float dist=0 float dd=1E20 int g=0 loop: final: z=#z g=1 while g<@row+2 test1 = (z-pr[g,1])/(pr[g,2]-pr[g,1]) ; print(" pr[g,1]=",pr[g,1]) ; print(" pr[g,2]=",pr[g,2]) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pr[g,2]-pr[g,1]) if dist1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pc[g,1]-pc[g,2]) if dist 0 && test2 <1 && abs(test1) < @dikte ) test1=(@dikte-test1)*.5 c = test1/(@dikte) #index=c iter=360*@n endif endif if @var==2||@var==3 && cabs(#z) 0 && test2 <1 && abs(test1) < @dikte/2 ) c=.5+test1/@dikte #index=c iter=360*@n ENDIF endif if abs(h2-#pi/2)>0.001 hh=(hhh+h)/2 if h2>#pi/2 hh=hh+#pi endif pt1=sqrt(r1*r1+r*r)*(cos(hh)+i*sin(hh)) test1=cabs(#z-pt1)-r1 if abs(test1)<@dikte/2 c=.5+test1/@dikte #index=c iter=360*@n endif endif endif iter=iter+@ang endwhile IF c == 0 IF @sol #solid = true ENDIF ENDIF default: title = "Looms" param radius caption = "radius " default = 1.9 endparam param ang caption = "Degrees betw.lines " default = 1.0 endparam param a caption = "Parameter1" default = 2.0 endparam param b caption = "Parameter2" enabled = @var== "Circle" hint="Does nothing with Square or Hyperbolic" default = 2.0 endparam param var caption = "Shape " enum = "Circle" "Square" "Hyperbolic" "Hyperbolic2" default = 0 endparam param n caption = "Go round x times" default = 1.0 endparam param dikte Caption = "Line thickness" Default = 0.005 endparam param sol caption="Solid background?" default= FALSE endparam } LoomsII { ; Jos Leys, April 2005. ; Looms II uses a different calculation mode than the former version, and ; should be considered a new UCL. It is at least 30 times faster: the same ; parameters take 2 seconds where they took a minute to calculate in the old ; 'Looms'. This is accomplished through the extensive use of arrays for ; precalculation of results. This puts a heavy demand on memory, and in some ; cases can result in 'Out of Memory' errors, especially if multiple layers ; that use LoomsII are stacked in a UPR. This is because UF3 calculates these ; layers simultaneously. ( UF4 will do this consecutively, which solves this ; problem) ; It was written to be used with the 'Pixel' formula (ie no formula) but ; interesting results may come of other formulas also. ; ; Looms II has four options: all of them draw arrangements of straight lines. ; Lines close together can generate annoying Moiré patterns. Possible solutions ; are: rendering to disk with anti-alias setting 'Treshold=0', and rendering at ; a larger size than the finished image. ; Looms II will draw a maximum of 36,000 lines in one image. ; Options : ; LOOMS: ; ..draws a series of lines where one end of the line is on a circle, and the ; other end is defined by two parameters. If these parameters are equal, then ; the other end of the line is on the same circle. ; FLOWER: ; Draws a 'flower' curve which is a circle with a sine wave superimposed. ; One end of the line is on this curve, and the other is also, but displaced ; at an angle defined by the "Offset" parameter. ; SPIRO ; same principle as 'Flower', but now the curve is defined by a circle rolling ; on another circle ; LISSAJOUS ; again, the same principle, but now the curve is a Lissajous curve. ; ; In all cases, the basic curve can be seen by checking the 'Draw basic shape' ; box. ; Depending on the parameter values, the basic curves only closes on itself ; if the calculation is repeated during several revolutions around a circle. ; The "Go around auto" parameter provides for an easy way to do this ; automatically. ; "Pseudo 3D "stacks the lines on top of one another, for a 3D effect. ; ; The color of the lines can be chosen if a gradient is used with equally ; spaced color bands. For instance, for a gradient with 8 color bands, ; Line color=0 will pick the first color band, Line color=7 will pick the ; last color band. If #Color bands =1, the Line color=0 will use the first ; half of the gradient to color the lines... ; Two coloring options added April 10 ; with thanks to Jos Boogen for extensive testing... global: COMPLEX i= (0,1) int bl =200 int count[41250] float hk[36002] float tag[36002] complex pp1[36002] complex pp2[36002] int VC[41250,500] int vak1[203,203] ; $define DEBUG int a=0 int q=0 int j=0 int u=0 int rr=0 int im=0 int rra=0 int ima=0 int max=0 int fl=0 float ratio=#height/#width if ratio<.75 float sx=1.5/#magn/ratio float sy=1.5/#magn else float sx=2/#magn float sy=2*ratio/#magn endif int u=0 float Rad=@rad float realpunt= 0 float imagpunt= 0 complex punt=0 ;----------------------------------------------VANAF HIER DE LOOP float n=@n float it=@itang float pets=@pet float os=@offset*#pi/180 int nn=0,int nold=0 int tel=1 float rat=0,float rat1=0,float rat2=0 float aa=@a,float b=@b if @dbs && @var==0,aa=1.01 , b=1.01,endif if @auto||(@dbs&& @var !=0) n=10 bool stop=false if @var==1 rat1=pets tel=1 endif if @var==2 rat1=abs(@radspir/@rad2spir) tel=1 endif if @var==3 || @var==0 rat1=abs(aa) rat2=abs(b) tel=2 endif j=1 while j1-@d col=(@lcolor+(a-(1-@d))/@d)/@colors endif endif #index = col if col==0 #solid=true endif default: title = "One circle" param d caption = "Ring thickness" default = .1 endparam param lcolor caption = "Ring color" default = 0.0 endparam param cc Caption = "Color the circle" Default = TRUE endparam param vcolor caption = "Circle color" default = 0.0 endparam param ls Caption = "Light source?" Default = TRUE endparam param lsang Caption = "Light angle?" Default = 60.0 visible=(@ls==true) endparam param lselev Caption = "Light elev (0-0.7)?" Default = 0.4 Max=0.7 Min=0.0 visible=(@ls==true ) endparam param colors caption="Number of colors" default= 8 endparam } Starfield (BOTH) { ; By Jos Leys , January 2005 ; Use with Pixel formula, or any other formula at your own risk ; Thanks to Jos Boogen, André Vandergoten and Lilliane Rosschaert for ; testing and some improvement suggestions. global: float ratio=#height/#width if ratio<.75 float sx=1.5/#magn/ratio float sy=1.5/#magn else float sx=2/#magn float sy=2*ratio/#magn endif complex i=(0,1) complex nstarpos[@st+2] float nstarsize[@st+2] float nstarcol[@st+2] complex shstarpos[@shst+2] float shstarsize[@shst+2] float shstarcol[@st+2] int t=0 int seed = @zaad float ran=0 while t< @st+1 t=t+1 seed = random(seed) ran = abs(seed)/#randomrange float x=ran*2*sx-sx+real(#center) seed = random(seed) ran = abs(seed)/#randomrange float y=ran*2*sy-sy+imag(#center) nstarpos[t]=x+i*y seed = random(seed) ran = abs(seed)/#randomrange nstarsize[t]=ran*2*sx*@stsize/2000 nstarcol[t]=trunc(ran*@nc) endwhile t=0 float ran=0 seed = random(seed) while t< @shst+1 t=t+1 seed = random(seed) ran = abs(seed)/#randomrange float x=ran*2*sx-sx+real(#center) seed = random(seed) ran = abs(seed)/#randomrange float y=ran*2*sy-sy+imag(#center) shstarpos[t]=x+i*y seed = random(seed) ran = abs(seed)/#randomrange shstarsize[t]=ran*2*sx*@shstsize/2000 shstarcol[t]=trunc(ran*@nc) endwhile init: float c=0 loop: final: ; ronde sterren int jj=1 while jj<@st+1 float d=cabs(#z-nstarpos[jj])/nstarsize[jj] if d<1 c=(1-d)/@nc/2+nstarcol[jj]/@nc jj=@st endif jj=jj+1 endwhile ; puntige sterren/vierkant int b=4 jj=1 while jj<@shst+1 float a = shstarsize[jj] float zx=abs(real(#z-shstarpos[jj])) float zy=abs(imag(#z-shstarpos[jj])) if zx< a && zy< a float an=a^b if zy>zx float zxx=zx zx=zy zy=zxx endif float dy=a-(an-(a-zx)^b)^(1/b) if zy1 ka=#height else ka=#width endif ;sx=sx/cos(#angle) ; sy=sy/sin(#angle) PRINT ("sx=",sx) PRINT ("sy=",sy) int ext=ceil(@d/(ka/100)) while x3 && lev>1) lev=lev-1 endwhile endif tag[lev]=tag[lev]+1 endif; voor flag=1 flag=0 endwhile endif ; voor flag=1 j=0 print("count ",count) ; KLASSEREN VAN PUNTEN int im=0 int rra=0 int uu=0 j=0 int n=1 int u=1 while j0 if vakh[uu]==0 vakh[uu]=n n=n+1 endif counth[vakh[uu]]=counth[vakh[uu]]+1 HH[vakh[uu],counth[vakh[uu]]]=j endif uu=uu+1 endwhile uu=rra-ext while uu0 if vakv[uu]==0 vakv[uu]=u u=u+1 endif countv[vakv[uu]]=countv[vakv[uu]]+1 VV[vakv[uu],countv[vakv[uu]]]=j endif uu=uu+1 endwhile j=j+1 endwhile ; TOT HIER PUNTEN KLASSEREN init: int aaa=0 int bbb=0 int gg=0 float c=0 float dist=0 float dd=1E20 float test=0 loop: final: z=#pixel ;---------------Fractal tekenen if @sf bbb=trunc(imag(z-OR)/(2*sy/#height)) aaa=trunc(real(z-OR)/(2*sx/#width)) if P[aaa,bbb]==0 c=0.0 endif if P[aaa,bbb]==1 c=@fc endif endif ;---------------Tot hier Fractal tekenen aaa=trunc(imag(z-OR)/(2*sy/100)) bbb =trunc(real(z-OR)/(2*sx/100)) ; print("counth[vakh[aaa] ",counth[vakh[aaa]]) gg=0 while gg1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist1, then the same curve is redrawn, starting where the ; first one ended, and rotated over an angle so that the end of the last curve ; meets the start of the first curve. Consecutive curves may overlap for a good part. ; Base distance: the distance between two folds.This is automatically reduced in size ; as the Number of iterations increases in order to minimize rearrangeing the Location ; Angle 1: the angle between the first two segments of the curve. ; Angle 2: the angle used for the subsequent foldings. ; Alternate angles: alternatively fold using angle 1 and angle 2. ; Variation: ; - Lines: straight lines: what you would get if you actually folded paper. ; - Rounded lines: a little rounding where the lines meet ; - False sinus : an undulating line instead of a straight line ; - Semi circles: half circles instead of straight lines ; - Spirals: the line spirals from one point to the next ( you can choose how many loops ; it takes to get there. ; Coloring parameters: ; - Gradient: ; Use a gradient with evenly spaced color bands. Number of colors = the number of ; color bands. Line color is the position of the color band, starting from the ; left hand side. First one= zero, last one= number of colors minus one. ; Different colors are used only if Consecutive iterations>1: subsequent curves get ; a different color. ; - Direct ; A direct coloring scheme. Six colors are available. ; Line color ( 1 to 6) chooses the color for the line. ; With 'Different colors' checked, you can choose the color of the curves if Consecutive ; iterations>1. ; Have fun. Send any comments to jos.leys@pandora.be GLOBAL: ;$DEFINE DEBUG color colormin [6] colormin[0]=@colorMin1 colormin[1]=@colorMin2 colormin[2]=@colorMin3 colormin[3]=@colorMin4 colormin[4]=@colorMin5 colormin[5]=@colorMin6 color colormax [6] colormax[0]=@colorMax1 colormax[1]=@colorMax2 colormax[2]=@colorMax3 colormax[3]=@colorMax4 colormax[4]=@colorMax5 colormax[5]=@colorMax6 color colorMap [6, 3] IF @dfclr colorMap [0, 1]=colormin[@clrlijndirit1],colorMap [0, 2]=colormax[@clrlijndirit1] colorMap [1, 1]=colormin[@clrlijndirit2],colorMap [1, 2]=colormax[@clrlijndirit2] colorMap [2, 1]=colormin[@clrlijndirit3],colorMap [2, 2]=colormax[@clrlijndirit3] colorMap [3, 1]=colormin[@clrlijndirit4],colorMap [3, 2]=colormax[@clrlijndirit4] colorMap [4, 1]=colormin[@clrlijndirit5],colorMap [4, 2]=colormax[@clrlijndirit5] colorMap [5, 1]=colormin[@clrlijndirit6],colorMap [5, 2]=colormax[@clrlijndirit6] ELSE colorMap [0, 1]=colormin[@clrlijndirit1],colorMap [0, 2]=colormax[@clrlijndirit1] colorMap [1, 1]=colormin[@clrlijndirit1],colorMap [1, 2]=colormax[@clrlijndirit1] colorMap [2, 1]=colormin[@clrlijndirit1],colorMap [2, 2]=colormax[@clrlijndirit1] colorMap [3, 1]=colormin[@clrlijndirit1],colorMap [3, 2]=colormax[@clrlijndirit1] colorMap [4, 1]=colormin[@clrlijndirit1],colorMap [4, 2]=colormax[@clrlijndirit1] colorMap [5, 1]=colormin[@clrlijndirit1],colorMap [5, 2]=colormax[@clrlijndirit1] ENDIF INT ni = @N float d = @dikte/ni float rr=0.0 float bas=0 complex i=(0.0,1.0) float hk1=@hk1*#pi/180 float hk2=@hk2*#pi/180 INT n = @colors if @var==0 rr=@rr/ni/3/#pi bas=@ac*#pi*rr*4 endif if @var==1 float bas=(@rr+d)/ni endif if (@var==2 || @var==3) bas=(@rr+3*d)/ni endif if (@var==4||@var==5) bas=@rr/ni endif IF abs(hk1)>=abs(hk2) float target=2*bas*cos((#pi-abs(hk1))/2)*1.2 if d>bas float target=2*d*cos((#pi-abs(hk1))/2)*1.2 endif else float target=2*bas*cos((#pi-abs(hk2))/2)*1.2 if d>bas float target=2*d*cos((#pi-abs(hk2))/2)*1.2 endif endif if target= H[g] h1= h1-2*#pi endif h2 = atan2(z-pp2[g]) if h2 < 0 h2= h2+2*#pi endif HH=H[g]-#pi if HH < 0 HH= HH+2*#pi endif h3=h2 if h2 >= HH h3= h2-2*#pi endif b=1 while b<@ac+1 r1=abs(rr*(H[g]-h1)) r2=abs(rr*(HH-h3)) h1=h1-2*#pi h3=h3-2*#pi test1 = abs(r1 - SQRT(|z-pp1[g]|)) test2 = test1-d/2 test4 = abs(r2 - SQRT(|z-pp2[g]|)) test5 = test4-d/2 IF ((d/2-test1 > 0 && test2 <0)||(d/2-test4 > 0 && test5 <0)) b=@ac+1 test1=d/2-test1 test4=d/2-test4 count=g endif b=b+1 endwhile endif ;---------------------------------------------- if @var==1 ctr3= (pp1[g]+pp2[g])/2 h1 = atan2(z-ctr3) if h1 < 0 h1= h1+2*#pi endif h2=h1+#pi-H[g] if h2>2*#pi h2=h2-2*#pi endif if h2<0 h2=h2+2*#pi endif if pimp[g] == 1 if (h2>#pi && h2<2*#pi) dist=abs(bas/2- cabs(z -ctr3)) if dist0 && dist
0 && h2<#pi) dist=abs(bas/2- cabs(z -ctr3)) if dist0 && dist
0 && dist
2*#pi h2=h2-2*#pi endif if h2<0 h2=h2+2*#pi endif if (h2>#pi && h2<2*#pi) dist=abs(bas/4- cabs(z -ctr3)) if dist0 && dist
0 && dist
2*#pi h2=h2-2*#pi endif if h2<0 h2=h2+2*#pi endif if (h2>0 && h2<#pi) dist=abs(bas/4- cabs(z -ctr4)) if dist0 && dist
0 && dist
2*#pi h2=h2-2*#pi endif if h2<0 h2=h2+2*#pi endif if pimp2[g] == 0 if (h2>#pi && h2<2*#pi) dist=abs(bas/4 - cabs(z -ctr3)) if dist0 && dist
0 && h2<#pi) dist=abs(bas/4- cabs(z -ctr3)) if dist0 && dist
0 && dist
2*#pi h2=h2-2*#pi endif if h2<0 h2=h2+2*#pi endif if pimp2[g] == 0 if (h2>0 && h2<#pi) dist=abs(bas/4- cabs(z -ctr4)) if dist0 && dist
0 && dist
#pi && h2<2*#pi) dist=abs(bas/4- cabs(z -ctr4)) if dist0 && dist
0 && dist
1 dist=cabs(test6-1) else dist=abs(imag(test6)) endif dist=dist*cabs(ctr2-ctr1) if dist1 dist=cabs(test6-1) else dist=abs(imag(test6)) endif dist=dist*cabs(zz2-zz1) if dist 0 && test2 <0)||(test4 > 0 && test5 <0)) IF (test4 > 0 && test5 <0) test1=test4 endif if @colormode==0 c= clr[cc[count]]+test1/d #color = gradient( c/n ) elseif @colormode==1 gindex = test1/d if cc[count]>5 cc[count]=cc[count]%6 endif #color = blend (colorMap [cc[count], 1], colorMap [cc[count], 2], gindex) endif ENDIF g=g+1 endwhile IF (c == 0 && @colormode==0)||(gindex == 0 && @colormode==1) IF @sol #solid = true ENDIF ENDIF default: title = "The Dragoncurve" param version caption = "Formula Version" default = 1 visible = false endparam int param N caption = "Number of iterations" default = 1 endparam int param it caption = "Consecutive iterations" default = 1 hint="Consecutive curves, starting where the previous one ended" endparam param rr caption = "Base distance" default = 1.0 endparam param hk1 caption = "Angle 1 - degrees" default = 90.0 hint="The angle between the first two elements: the angle that you see when #iterations=1" endparam param hk2 caption = "Angle 2 - degrees" default = 90.0 hint=" The angle by which the the first two elements are rotated in subsequent iterations." endparam param ah caption = "Alternate angles?" default = FALSE hint="Use angle 1 and angle 2 alternatively for subsequent rotations" endparam param dikte Caption = "Line thickness " Default = 0.1 endparam param var Caption = "Variation" enum= "Spirals" "Semi circles" "False sinus" "False sinus2" "Lines" "Rounded Lines" Default = 0 endparam param ac Caption= "Number of loops" Default = 1 visible= (@var=="Spirals") endparam heading caption = "Coloring Settings" endheading param colormode Caption = "Coloring mode" enum= "Gradient" "Direct" Default = 1 endparam int param colors caption="Number of colors" default= 8 hint=" Use a gradient with n color bands" visible=(@colormode==0) endparam int param clrlijn caption="Line Color" visible=(@colormode==0) hint="If your gradient has eg 8 color bands, they are numbered 0 to 7" default= 0 endparam int param clrlijnit2 caption="Line Color,it2" hint="If your gradient has eg 8 color bands, they are numbered 0 to 7" default= 1 visible=(@colormode==0)&&(@dfclr==TRUE)&&(@it>1) endparam int param clrlijnit3 caption="Line Color,it3" hint="If your gradient has eg 8 color bands, they are numbered 0 to 7" default= 2 visible=(@colormode==0)&&(@dfclr==TRUE)&&(@it>2) endparam int param clrlijnit4 caption="Line Color,it4" hint="If your gradient has eg 8 color bands, they are numbered 0 to 7" default= 3 visible=(@colormode==0)&&(@dfclr==TRUE)&&(@it>3) endparam int param clrlijnit5 caption="Line Color,it5" hint="If your gradient has eg 8 color bands, they are numbered 0 to 7" default= 4 visible=(@colormode==0)&&(@dfclr==TRUE)&&(@it>4) endparam int param clrlijnit6 caption="Line Color,it6" hint="If your gradient has eg 8 color bands, they are numbered 0 to 7" default= 5 visible=(@colormode==0)&&(@dfclr==TRUE)&&(@it>5) endparam int param clrlijnit7 caption="Line Color,it7" hint="If your gradient has eg 8 color bands, they are numbered 0 to 7" default= 6 visible=(@colormode==0)&&(@dfclr==TRUE)&&(@it>6) endparam int param clrlijnit8 caption="Line Color,it8" hint="If your gradient has eg 8 color bands, they are numbered 0 to 7" default= 7 visible=(@colormode==0)&&(@dfclr==TRUE)&&(@it>7) endparam param dfclr caption="Different colors?" hint="Different colors for consecutive iterations" default= False endparam int param clrlijndirit1 caption="Line Color" enum="1""2""3""4""5""6" hint="Choose line color for Curve 1" default= 0 visible=(@colormode==1) endparam int param clrlijndirit2 caption="Line Color,it2" enum="1""2""3""4""5""6" hint="Choose line color for Curve 2" default= 1 visible=(@colormode==1) &&(@dfclr==True) &&(@it>1) endparam int param clrlijndirit3 caption="Line Color,it3" enum="1""2""3""4""5""6" hint="Choose line color for Curve 3" default= 2 visible=(@colormode==1) &&(@dfclr==True) &&(@it>2) endparam int param clrlijndirit4 caption="Line Color,it4" enum="1""2""3""4""5""6" hint="Choose line color for Curve 4" default= 3 visible=(@colormode==1) &&(@dfclr==True) &&(@it>3) endparam int param clrlijndirit5 caption="Line Color,it5" enum="1""2""3""4""5""6" hint="Choose line color for Curve 5" default= 4 visible=(@colormode==1) &&(@dfclr==True) &&(@it>4) endparam int param clrlijndirit6 caption="Line Color,it6" enum="1""2""3""4""5""6" hint="Choose line color for Curve 6" default= 5 visible=(@colormode==1) &&(@dfclr==True) &&(@it>5) endparam color param colorMax1 caption = "Color Range 1 High" default = rgb(170/255,170/255,255/255) hint = "Specifies the color at the high end of Range #1." visible = (@colormode == 1) endparam color param colorMin1 caption = "Color Range 1 Low" default = rgb(12/255,0/255,103/255) hint = "Specifies the color at the low end of Range #1." visible = (@colormode == 1) endparam color param colorMax2 caption = "Color Range 2 High" default = rgb(255/255,255/255,230/255) hint = "Specifies the color at the high end of Range #2." visible = (@colormode == 1) endparam color param colorMin2 caption = "Color Range 2 Low" default = rgb(17/255,168/255,0/255) hint = "Specifies the color at the low end of Range #2." visible = (@colormode == 1) endparam color param colorMax3 caption = "Color Range 3 High" default = rgb(255/255,255/255,230/255) hint = "Specifies the color at the high end of Range #3." visible = (@colormode == 1) endparam color param colorMin3 caption = "Color Range 3 Low" default = rgb(221/255,0/255,0/255) hint = "Specifies the color at the low end of Range #3." visible = (@colormode == 1) endparam color param colorMax4 caption = "Color Range 4 High" default = rgb(255/255,255/255,113/255) hint = "Specifies the color at the high end of Range #4." visible = (@colormode == 1) endparam color param colorMin4 caption = "Color Range 4 Low" default = rgb(206/255,206/255,0/255) hint = "Specifies the color at the low end of Range #4." visible = (@colormode == 1) endparam color param colorMax5 caption = "Color Range 5 High" default = rgb(255/255,255/255,230/255) hint = "Specifies the color at the high end of Range #5." visible = (@colormode == 1) endparam color param colorMin5 caption = "Color Range 5 Low" default = rgb(0/255,188/255,221/255) hint = "Specifies the color at the low end of Range #5." visible = (@colormode == 1) endparam color param colorMax6 caption = "Color Range 6 High" default = rgb(255/255,255/255,64/255) hint = "Specifies the color at the high end of Range #6." visible = (@colormode == 1) endparam color param colorMin6 caption = "Color Range 6 Low" default = rgb(220/255,111/255,0/255) hint = "Specifies the color at the low end of Range #6." visible = (@colormode == 1) endparam param sol caption="Solid background?" default= TRUE endparam } 3DBackdrop (BOTH) { ; By Jos Leys, January 2003 ; Use with the Pixel formula ; Updated June 2005 init: int n=@n int cnt=0 float x1=0.0 float y1=0.0 float hh1=60*#pi/180 float test=0.0 int zaad=@seed complex test1=0.0 float a=0.0 float c=0.0 float cc=0.0 float d= @d int var=@var float hh=0.0 float h=0.0 float h2=0.0 float h3=0.0 float h4=0.0 float r=0.0 float fh=0 float dd=1E20 float dist=0 complex i = (0.0,1.0) complex MIN = 0.0 complex pt1 = (0.0,0.0) complex pt2 = (0.0,0.0) ; $define debug loop: final: z=#z c=0 y1=(imag(#z))/sin(hh1) x1=real(#z)-y1*cos(hh1) if y1<0 y=floor(y1) else y=trunc(y1) endif if x1<0 x=floor(x1) else x=trunc(x1) endif z1=x+y*cos(hh1)+i*y*cos(hh1/2) z2=z1+1 z3=z1+.5+i*cos(hh1/2) z4=z1+1.5+i*cos(hh1/2) MIN=z1 if cabs(z-MIN)>cabs(z-z2) MIN=z2 endif if cabs(z-MIN)>cabs(z-z3) MIN=z3 endif if cabs(z-MIN)>cabs(z-z4) MIN=z4 endif ; foefje voor pat=23 zaad=trunc((real(MIN))*(imag(MIN+.0001*i))*zaad*100) if imag(MIN)<.8 print("MIN=",MIN) print("zaad=",zaad) endif zaad=random(zaad) int offset=abs(zaad) % 10 if imag(MIN)<.8 print("zaad=",zaad) print("offset=",offset) endif ; tot hier h=atan2(z-MIN) if h<0 h=h+2*#pi endif hh=trunc((h+hh1/2)/(hh1)) if hh%2==1 fh=1 else fh=0 endif h=h+hh1/2-hh*hh1-hh1/2 z=cabs(z-MIN)*( cos(h)+i*sin(h)) a=.5/cos(hh1/2) ;------------------------------------- if @pat==0||@pat==1 cnt=1 while cnt<10 if cnt==1 pt1=a*(cos(hh1/2)+i);*sin(hh1/2) pt2=a*(cos(hh1/2)+i*sin(hh1/2)/3) elseif cnt==2&& @pat==0 pt1=a*(cos(hh1/2)-i) pt2=a*(cos(hh1/2)-i*sin(hh1/2)/3) elseif cnt==2 && @pat==1 pt1=a*(cos(hh1/2)+i) pt2=a*(cos(hh1/2)-i) elseif cnt==3 pt1=a*(cos(hh1/2)+i*sin(hh1/2)/3) pt2=2*a*cos(hh1/2)/3 elseif cnt==4 pt1=2*a*cos(hh1/2)/3 pt2=a*i/3;(cos(hh1/2)+i*sin(hh1/2))/3 elseif cnt==5 pt1=2*a*cos(hh1/2)/3 pt2=2*a*(cos(hh1/2)/3-i) elseif cnt==6 pt1=a*(cos(hh1/2)+i*sin(hh1/2)/3) pt2=2*a*i/3;(cos(hh1/2)+i*sin(hh1/2))/3 elseif cnt==7 && fh==1 pt1=0 pt2=a*(cos(hh1/2)+i*sin(hh1/2))/3 elseif cnt==8 && fh==1 pt1=a*(cos(hh1/2)+i)/3 pt2=a*(cos(hh1/2)-i)/3 elseif cnt==9 && fh==0 pt1=0 pt2=a*(cos(hh1/2)-i*sin(hh1/2))/3 endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist2*.5/3 && imag(z)<(real(z)- 2*.5/3)*tan(hh1/2) if hh%3==0 c=@clrvlak1+.5 endif if hh%3==1 c=@clrvlak2+.5 endif if hh%3==2 c=@clrvlak3+.5 endif if @pat==1 if hh%6==0 c=@clrvlak1+.5 endif if hh%6==1 c=@clrvlak2+.5 endif if hh%6==2 c=@clrvlak3+.5 endif if hh%6==3 c=@clrvlak4+.5 endif if hh%6==4 c=@clrvlak5+.5 endif if hh%6==5 c=@clrvlak6+.5 endif endif endif if imag(z)>2*a*sin(hh1/2)/3-(real(z)- 2*a*COS(hh1/2)/3)*tan(hh1/2) if hh%3==2 c=@clrvlak1+.5 endif if hh%3==0 c=@clrvlak2+.5 endif if hh%3==1 c=@clrvlak3+.5 endif if @pat==1 if hh%6==0 c=@clrvlak2+.5 endif if hh%6==1 c=@clrvlak3+.5 endif if hh%6==2 c=@clrvlak4+.5 endif if hh%6==3 c=@clrvlak5+.5 endif if hh%6==4 c=@clrvlak6+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif endif if imag(z)a*COS(hh1/2)/3\ && real(z)<2*a*COS(hh1/2)/3 if hh%3==2 c=@clrvlak1+.5 endif if hh%3==0 c=@clrvlak2+.5 endif if hh%3==1 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)/3-(real(z)- a*COS(hh1/2)/3)*tan(hh1/2)\ && imag(z)>(real(z)- 2*a*COS(hh1/2)/3)*tan(hh1/2)\ && imag(z)<2*a*sin(hh1/2)/3-(real(z)-2*a*COS(hh1/2)/3)*tan(hh1/2) if hh%3==2 c=@clrvlak2+.5 endif if hh%3==0 c=@clrvlak3+.5 endif if hh%3==1 c=@clrvlak1+.5 endif endif if real(z)1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist=.4 && imag(z)<(real(z)- .4)*tan(hh1/2)+a*sin(hh1/2)*2/5 if hh%3==0 c=@clrvlak1+.5 endif if hh%3==1 c=@clrvlak2+.5 endif if hh%3==2 c=@clrvlak3+.5 endif endif if real(z)>=.4 && imag(z)>a*sin(hh1/2)*4/5-(real(z)- .4)*tan(hh1/2) if hh%3==0 c=@clrvlak2+.5 endif if hh%3==1 c=@clrvlak3+.5 endif if hh%3==2 c=@clrvlak1+.5 endif endif if real(z)>.3 && imag(z)>a*sin(hh1/2)*3/5-(real(z)-.3)*tan(hh1/2)\ && imag(z)>a*sin(hh1/2)*2/5+(real(z)-.4)*tan(hh1/2)\ && imag(z).3 && real(z)<.4 && imag(z).2 && real(z)<.3 && imag(z)>a*sin(hh1/2)*2/5-(real(z)-.2)*tan(hh1/2) if hh%3==0 c=@clrvlak2+.5 endif if hh%3==1 c=@clrvlak3+.5 endif if hh%3==2 c=@clrvlak1+.5 endif endif if real(z)>.1 && real(z)<.3 && imag(z)(real(z)-.2)*tan(hh1/2)&& imag(z)>a*sin(hh1/2)*1/5-(real(z)-.1)*tan(hh1/2) if hh%3==0 c=@clrvlak3+.5 endif if hh%3==1 c=@clrvlak1+.5 endif if hh%3==2 c=@clrvlak2+.5 endif endif if real(z)>.2 && real(z)<.3 && imag(z)<(real(z)-.2)*tan(hh1/2) if hh%3==0 c=@clrvlak1+.5 endif if hh%3==1 c=@clrvlak2+.5 endif if hh%3==2 c=@clrvlak3+.5 endif endif if fh==0 && real(z)<.2 && imag(z).1 && imag(z)1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist.5*5/6 if hh%6==0 || hh%6==1 c=@clrvlak1+.5 endif if hh%6==2 || hh%6==3 c=@clrvlak2+.5 endif if hh%6==4 || hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*2/6-(real(z)-.5*2/6)*tan(hh1/2) &&\ imag(z)-a*sin(hh1/2)*3/6+(real(z)-.5*3/6)*tan(hh1/2) && fh==1 if hh%6==1 c=@clrvlak1+.5 endif if hh%6==3 c=@clrvlak2+.5 endif if hh%6==5 c=@clrvlak3+.5 endif endif if REAL(z)>.5*2/6 && REAL(z)<.5*3/6 if hh%6==0 || hh%6==1 c=@clrvlak1+.5 endif if hh%6==2 || hh%6==3 c=@clrvlak2+.5 endif if hh%6==4 || hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*3/6-(real(z)-.5*3/6)*tan(hh1/2) &&\ imag(z)-a*sin(hh1/2)*4/6+(real(z)-.5*4/6)*tan(hh1/2) && real(z)<.5*5/6 && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/6+(real(z)-.5*3/6)*tan(hh1/2) && real(z)<.5*4/6 && fh==0 if hh%6==0 c=@clrvlak3+.5 endif if hh%6==2 c=@clrvlak1+.5 endif if hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>a*sin(hh1/2)*3/6-(real(z)-.5*3/6)*tan(hh1/2) && real(z)<.5*4/6 && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif if imag(z).5*4/6 && fh==0 if hh%6==0 c=@clrvlak3+.5 endif if hh%6==2 c=@clrvlak1+.5 endif if hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/6+(real(z)-.5*1/6)*tan(hh1/2) && real(z)<.5*5/6\ && real(z)>.5*4/6 && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)-a*sin(hh1/2)*3/6+(real(z)-.5*3/6)*tan(hh1/2) && real(z)<.5*4/6\ && real(z)>.5*3/6 && fh==0 if hh%6==0 c=@clrvlak2+.5 endif if hh%6==2 c=@clrvlak3+.5 endif if hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/6+(real(z)-.5*2/6)*tan(hh1/2) &&\ imag(z).5*3/6 && fh==1 if hh%6==1 c=@clrvlak3+.5 endif if hh%6==3 c=@clrvlak1+.5 endif if hh%6==5 c=@clrvlak2+.5 endif endif if imag(z).5*1/6 && fh==0 if hh%6==0 c=@clrvlak3+.5 endif if hh%6==2 c=@clrvlak1+.5 endif if hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/6+(real(z)-.5*1/6)*tan(hh1/2) && real(z)<.5*2/6\ && real(z)>.5*1/6 && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif if real(z)<.5*1/6 if hh%6==0 || hh%6==3 c=@clrvlak3+.5 endif if hh%6==1 || hh%6==4 c=@clrvlak2+.5 endif if hh%6==2 || hh%6==5 c=@clrvlak1+.5 endif endif endif ; voor var=1 endif ; voor @pat=3 if @pat==4 cnt=1 while cnt<32 if cnt==1 pt1=a*(cos(hh1/2)+i) pt2=a*(cos(hh1/2)-i) elseif cnt==2 && fh==0 pt1=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7+i) elseif cnt==3 && fh==1 pt1=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7-i) elseif cnt==4 && fh==0 pt1=a*(cos(hh1/2)*6/7) pt2=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*4/7) elseif cnt==5 && fh==1 pt1=a*(cos(hh1/2)*6/7) pt2=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*4/7) elseif cnt==6 && fh==0 pt1=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*4/7) pt2=a*i*10/14 elseif cnt==7 && fh==1 pt1=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*4/7) pt2=-a*i*10/14 elseif cnt==8 && fh==0 pt1=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*1/7) elseif cnt==9 && fh==1 pt1=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*1/7) elseif cnt==10 pt1=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*1/7) elseif cnt==11 && fh==0 pt1=a*(cos(hh1/2)*4/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*1/7) elseif cnt==12 && fh==1 pt1=a*(cos(hh1/2)*4/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*1/7) elseif cnt==13 && fh==0 pt1=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*4/7+i*sin(hh1/2)*4/7) elseif cnt==14 && fh==1 pt1=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*4/7-i*sin(hh1/2)*4/7) elseif cnt==15 && fh==0 pt1=a*(cos(hh1/2)*4/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7) elseif cnt==16 && fh==1 pt1=a*(cos(hh1/2)*4/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7) elseif cnt==17 && fh==0 pt1=a*(cos(hh1/2)*4/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*4/7) elseif cnt==18 && fh==1 pt1=a*(cos(hh1/2)*4/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*4/7) elseif cnt==19 pt1=a*(cos(hh1/2)*4/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*4/7-i*sin(hh1/2)*2/7) elseif cnt==20 && fh==0 pt1=a*(cos(hh1/2)*3/7-i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*3/7+i*sin(hh1/2)*3/7) elseif cnt==21 && fh==1 pt1=a*(cos(hh1/2)*3/7+i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*3/7-i*sin(hh1/2)*3/7) elseif cnt==22 && fh==0 pt1=a*(cos(hh1/2)*2/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*3/7+i*sin(hh1/2)*1/7) elseif cnt==23 && fh==1 pt1=a*(cos(hh1/2)*2/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*3/7-i*sin(hh1/2)*1/7) elseif cnt==24 && fh==0 pt1=a*(cos(hh1/2)*1/7+i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*3/7-i*sin(hh1/2)*1/7) elseif cnt==25 && fh==1 pt1=a*(cos(hh1/2)*1/7-i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*3/7+i*sin(hh1/2)*1/7) elseif cnt==26 && fh==0 pt1=0 pt2=a*(cos(hh1/2)*7/7-i*sin(hh1/2)*7/7) elseif cnt==27 && fh==1 pt1=0 pt2=a*(cos(hh1/2)*7/7+i*sin(hh1/2)*7/7) elseif cnt==28 && fh==0 pt1=a*(cos(hh1/2)*1/7+i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*2/7+i*sin(hh1/2)*2/7) elseif cnt==29 && fh==1 pt1=a*(cos(hh1/2)*1/7-i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*2/7-i*sin(hh1/2)*2/7) elseif cnt==30 && fh==0 pt1=a*(cos(hh1/2)*4/7+i*sin(hh1/2)*4/7) pt2=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*5/7) elseif cnt==31 && fh==1 pt1=a*(cos(hh1/2)*4/7-i*sin(hh1/2)*4/7) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*5/7) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist.5*6/7 if hh%6==0 || hh%6==1 c=@clrvlak1+.5 endif if hh%6==2 || hh%6==3 c=@clrvlak2+.5 endif if hh%6==4 || hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) &&\ imag(z)-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) && fh==1 if hh%6==1 c=@clrvlak1+.5 endif if hh%6==3 c=@clrvlak2+.5 endif if hh%6==5 c=@clrvlak3+.5 endif endif if REAL(z)>.5*3/7 && REAL(z)<.5*4/7 if hh%6==0 || hh%6==1 c=@clrvlak1+.5 endif if hh%6==2 || hh%6==3 c=@clrvlak2+.5 endif if hh%6==4 || hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && fh==1 if hh%6==1 c=@clrvlak1+.5 endif if hh%6==3 c=@clrvlak2+.5 endif if hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*4/7-(real(z)-.5*4/7)*tan(hh1/2) &&\ imag(z)-a*sin(hh1/2)*5/7+(real(z)-.5*5/7)*tan(hh1/2) && real(z)<.5*6/7 && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) &&\ imag(z)>a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) && real(z)<.5*5/7 && fh==0 if hh%6==0 c=@clrvlak3+.5 endif if hh%6==2 c=@clrvlak1+.5 endif if hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) &&\ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)<.5*5/7 && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) && real(z)<.5*6/7 && real(z)>.5*5/7 && fh==0 if hh%6==0 c=@clrvlak3+.5 endif if hh%6==2 c=@clrvlak1+.5 endif if hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) &&\ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)<.5*6/7 && real(z)>.5*5/7 && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && real(z)<.5*5/7 && real(z)>.5*4/7 && fh==0 if hh%6==0 c=@clrvlak2+.5 endif if hh%6==2 c=@clrvlak3+.5 endif if hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)>-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) &&\ imag(z).5*4/7 && fh==1 if hh%6==1 c=@clrvlak3+.5 endif if hh%6==3 c=@clrvlak1+.5 endif if hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) && real(z)<.5*3/7&& fh==0 if hh%6==0 c=@clrvlak3+.5 endif if hh%6==2 c=@clrvlak1+.5 endif if hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) &&\ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)<.5*3/7 && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif endif ; voor var=1 endif ; voor @pat=4 if @pat==5 cnt=1 while cnt<20 if cnt==1 && fh==0 pt1=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)-i) elseif cnt==2 && fh==1 pt1=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)+i) elseif cnt==3 && fh==0 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*3/5) elseif cnt==4 && fh==0 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*1/5) elseif cnt==5 && fh==0 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*4/5-i) elseif cnt==6 && fh==0 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*4/5) pt2=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*5/5) elseif cnt==7 && fh==1 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*4/5) pt2=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*5/5) elseif cnt==8 && fh==0 pt1=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*3/5-i) elseif cnt==9 && fh==0 pt1=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*2/5-i*sin(hh1/2)*2/5) elseif cnt==10 && fh==0 pt1=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*1/5+i*sin(hh1/2)*1/5) elseif cnt==11 && fh==0 pt1=a*(cos(hh1/2)*2/5-i*sin(hh1/2)*2/5) pt2=0 elseif cnt==12 && fh==1 pt1=a*(cos(hh1/2)*2/5+i*sin(hh1/2)*2/5) pt2=0 elseif cnt==13 && fh==0 pt1=a*(cos(hh1/2)*1/5+i*sin(hh1/2)*1/5) pt2=0 elseif cnt==14 && fh==1 pt1=a*(cos(hh1/2)*1/5-i*sin(hh1/2)*1/5) pt2=0 elseif cnt==15 && fh==1 pt1=a*(cos(hh1/2)*1/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*2/5) elseif cnt==16 && fh==1 pt1=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*3/5) pt2=a*(cos(hh1/2)*2/5) elseif cnt==17 && fh==1 pt1=a*(cos(hh1/2)*2/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*1/5) elseif cnt==18 && fh==1 pt1=a*(cos(hh1/2)*3/5+i*sin(hh1/2)*3/5) pt2=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*1/5) elseif cnt==19 && fh==1 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*4/5+i) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist.5*4/5 && imag(z)a*sin(hh1/2)*3/5-(real(z)-.5*3/5)*tan(hh1/2) &&\ imag(z)<-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) && fh==0 if hh%6==0 c=@clrvlak3+.5 endif if hh%6==2 c=@clrvlak1+.5 endif if hh%6==4 c=@clrvlak2+.5 endif endif if real(z)>.5*2/5 && real(z)<.5*3/5 &&imag(z)<-a*sin(hh1/2)*2/5+(real(z)-.5*2/5)*tan(hh1/2) && fh==0 if hh%6==0 c=@clrvlak2+.5 endif if hh%6==2 c=@clrvlak3+.5 endif if hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)-a*sin(hh1/2)*2/5+(real(z)-.5*2/5)*tan(hh1/2) && fh==0 if hh%6==0 c=@clrvlak3+.5 endif if hh%6==2 c=@clrvlak1+.5 endif if hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>a*sin(hh1/2)*3/5-(real(z)-.5*3/5)*tan(hh1/2)&& real(z)>.5*4/5 && fh==1 if hh%6==1 c=@clrvlak1+.5 endif if hh%6==3 c=@clrvlak2+.5 endif if hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)a*sin(hh1/2)*2/5-(real(z)-.5*2/5)*tan(hh1/2) && fh==1 if hh%6==1 c=@clrvlak3+.5 endif if hh%6==3 c=@clrvlak1+.5 endif if hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)a*sin(hh1/2)*1/5-(real(z)-.5*1/5)*tan(hh1/2) && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif endif ; voor var=1 endif ; voor @pat=5 if @pat==6 cnt=1 while cnt<20 if cnt==1 pt1=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)-i) elseif cnt==2 pt1=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)+i) elseif cnt==3 && fh==0 pt1=a*(cos(hh1/2)*4/5+i) pt2=a*(cos(hh1/2)*4/5-i) elseif cnt==4 && fh==0 pt1=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*3/5-i) elseif cnt==5 && fh==0 pt1=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*2/5-i*sin(hh1/2)*2/5) elseif cnt==6 && fh==0 pt1=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*1/5+i*sin(hh1/2)*1/5) elseif cnt==7 && fh==0 pt1=a*(cos(hh1/2)*2/5-i*sin(hh1/2)*2/5) pt2=0 elseif cnt==8 && fh==1 pt1=a*(cos(hh1/2)*2/5+i*sin(hh1/2)*2/5) pt2=0 elseif cnt==9 && fh==0 pt1=a*(cos(hh1/2)*1/5+i*sin(hh1/2)*1/5) pt2=0 elseif cnt==10 && fh==1 pt1=a*(cos(hh1/2)*1/5-i*sin(hh1/2)*1/5) pt2=0 elseif cnt==11 && fh==1 pt1=a*(cos(hh1/2)*1/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*2/5) elseif cnt==12 && fh==1 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*2/5) elseif cnt==13 && fh==1 pt1=a*(cos(hh1/2)*2/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*1/5) elseif cnt==14 && fh==1 pt1=a*(cos(hh1/2)*3/5+i*sin(hh1/2)*3/5) pt2=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*1/5) elseif cnt==15 && fh==1 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*4/5+i) elseif cnt==16 && fh==1 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*4/5) pt2=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*5/5) elseif cnt==17 && fh==0 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*4/5) pt2=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*5/5) elseif cnt==18 && fh==1 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*1/5) elseif cnt==19 && fh==1 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*4/5-i) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist.5*4/5 && fh==0 if hh%6==0 c=@clrvlak1+.5 endif if hh%6==2 c=@clrvlak2+.5 endif if hh%6==4 c=@clrvlak3+.5 endif endif if real(z)>.5*2/5 && real(z)<.5*3/5 &&imag(z)<-a*sin(hh1/2)*2/5+(real(z)-.5*2/5)*tan(hh1/2) && fh==0 if hh%6==0 c=@clrvlak2+.5 endif if hh%6==2 c=@clrvlak3+.5 endif if hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)-a*sin(hh1/2)*2/5+(real(z)-.5*2/5)*tan(hh1/2) && fh==0 if hh%6==0 c=@clrvlak3+.5 endif if hh%6==2 c=@clrvlak1+.5 endif if hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>a*sin(hh1/2)*3/5-(real(z)-.5*3/5)*tan(hh1/2)&& real(z)>.5*4/5 && fh==1 if hh%6==1 c=@clrvlak1+.5 endif if hh%6==3 c=@clrvlak2+.5 endif if hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)a*sin(hh1/2)*2/5-(real(z)-.5*2/5)*tan(hh1/2) && fh==1 if hh%6==1 c=@clrvlak3+.5 endif if hh%6==3 c=@clrvlak1+.5 endif if hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)a*sin(hh1/2)*1/5-(real(z)-.5*1/5)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*3/5+(real(z)-.5*3/5)*tan(hh1/2) &&fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/5+(real(z)-.5*3/5)*tan(hh1/2)&& real(z)>.5*4/5 &&fh==1 if hh%6==1 c=@clrvlak1+.5 endif if hh%6==3 c=@clrvlak2+.5 endif if hh%6==5 c=@clrvlak3+.5 endif endif endif ; voor var=1 endif ; voor @pat=6 if @pat==7 cnt=1 while cnt<14 if cnt==1 pt1=a*(cos(hh1/2)*5/5-i) pt2=a*(cos(hh1/2)*5/5+i) elseif cnt==2 && fh==0 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*4/5+i) elseif cnt==3 && fh==1 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*4/5-i) elseif cnt==4 && fh==0 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*2/5) elseif cnt==5 && fh==1 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*2/5) elseif cnt==6 && fh==0 pt1=a*(cos(hh1/2)*1/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*5/5) elseif cnt==7 && fh==1 pt1=a*(cos(hh1/2)*1/5+i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*5/5) elseif cnt==8 && fh==0 pt1=0 pt2=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*4/5) elseif cnt==9 && fh==1 pt1=0 pt2=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*4/5) elseif cnt==10 && fh==0 pt1=a*(cos(hh1/2)*1/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) elseif cnt==11 && fh==1 pt1=a*(cos(hh1/2)*1/5+i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) elseif cnt==12 && fh==0 pt1=a*(cos(hh1/2)*4/5) pt2=a*(cos(hh1/2)*3/5+i*sin(hh1/2)*1/5) elseif cnt==13 && fh==1 pt1=a*(cos(hh1/2)*4/5) pt2=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*1/5) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist.5*4/5 if hh%6==0 || hh%6==1 c=@clrvlak1+.5 endif if hh%6==2 || hh%6==3 c=@clrvlak2+.5 endif if hh%6==4 || hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) &&\ imag(z)a*sin(hh1/2)*1/5-(real(z)-.5*1/5)*tan(hh1/2) &&\ imag(z)>-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) &&fh==1 if hh%6==1 c=@clrvlak1+.5 endif if hh%6==3 c=@clrvlak2+.5 endif if hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) &&\ imag(z)a*sin(hh1/2)*1/5-(real(z)-.5*1/5)*tan(hh1/2) && real(z)<.5*4/5 && fh==0 if hh%6==0 c=@clrvlak3+.5 endif if hh%6==2 c=@clrvlak1+.5 endif if hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>a*sin(hh1/2)*1/5-(real(z)-.5*1/5)*tan(hh1/2) &&\ imag(z)>-a*sin(hh1/2)*2/5+(real(z)-.5*2/5)*tan(hh1/2) &&\ imag(z)<-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) && real(z)<.5*4/5 && fh==1 if hh%6==1 c=@clrvlak2+.5 endif if hh%6==3 c=@clrvlak3+.5 endif if hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) && real(z)<.5*4/5 && fh==0 if hh%6==0 c=@clrvlak2+.5 endif if hh%6==2 c=@clrvlak3+.5 endif if hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) && hh%6==0 c=@clrvlak2+.5 endif if imag(z)-a*sin(hh1/2)*3/4+(real(z)-.5*3/4)*tan(hh1/2) && real(z)>.5*3/4 && hh%6==1 c=@clrvlak1+.5 endif if imag(z)<-a*sin(hh1/2)*3/4+(real(z)-.5*3/4)*tan(hh1/2) && hh%6==1 c=@clrvlak2+.5 endif if imag(z).5*3/4 && hh%6==2 c=@clrvlak2+.5 endif if imag(z)>a*sin(hh1/2)*1/4-(real(z)-.5*1/4)*tan(hh1/2) &&\ imag(z).5*1/4 &&hh%6==3 c=@clrvlak1+.5 endif if imag(z)<-a*sin(hh1/2)*3/4+(real(z)-.5*3/4)*tan(hh1/2) && hh%6==3 c=@clrvlak2+.5 endif if real(z)<.5*1/4 && hh%6==4 c=@clrvlak3+.5 endif if imag(z)>-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) && real(z)<.5*2/4 &&\ real(z)>.5*1/4 && hh%6==4 c=@clrvlak1+.5 endif if imag(z)>-a*sin(hh1/2)*2/4+(real(z)-.5*2/4)*tan(hh1/2) &&\ imag(z)<-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2)&& hh%6==4 c=@clrvlak1+.5 endif if imag(z)>-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) && real(z)>.5*2/4 && hh%6==4 c=@clrvlak2+.5 endif if real(z)>.5*3/4 && hh%6==5 c=@clrvlak3+.5 endif if imag(z)>-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) && hh%6==5 c=@clrvlak3+.5 endif if imag(z)<-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) &&\ imag(z)>-a*sin(hh1/2)*2/4+(real(z)-.5*2/4)*tan(hh1/2) && real(z)<.5*3/4 && hh%6==5 c=@clrvlak1+.5 endif endif ; voor var=1 endif ; voor @pat=8 ;----------------------------------------- if @pat==9 cnt=1 while cnt<13 if cnt==1 && (fh==0) pt1=a*(cos(hh1/2)*4/6-i*sin(hh1/2)*4/6) pt2=0 elseif cnt==2 && (fh==1 ) pt1=a*(cos(hh1/2)*4/6+i*sin(hh1/2)*4/6) pt2=0 elseif cnt==3 && (fh==0) pt1=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*6/6) pt2=0 elseif cnt==4 && (fh==1 ) pt1=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*6/6) pt2=0 elseif cnt==5 && (fh==0) pt1=a*(cos(hh1/2)*1/6+i*sin(hh1/2)*1/6) pt2=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*4/6) elseif cnt==6 && (fh==0) pt1=a*(cos(hh1/2)*2/6+i*sin(hh1/2)*0/6) pt2=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*4/6) elseif cnt==7 pt1=a*(cos(hh1/2)*6/6-i) pt2=a*(cos(hh1/2)*6/6+i) elseif cnt==8 && (fh==0) pt1=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*5/6) pt2=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*4/6) elseif cnt==9 && (fh==1) pt1=a*(cos(hh1/2)*2/6+i*sin(hh1/2)*0/6) pt2=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*3/6) elseif cnt==10 && (fh==1) pt1=a*(cos(hh1/2)*1/6-i*sin(hh1/2)*1/6) pt2=a*(cos(hh1/2)*4/6+i*sin(hh1/2)*2/6) elseif cnt==11 && (fh==1) pt1=a*(cos(hh1/2)*5/6+i) pt2=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*3/6) elseif cnt==12 && (fh==1) pt1=a*(cos(hh1/2)*4/6+i) pt2=a*(cos(hh1/2)*4/6-i*sin(hh1/2)*2/6) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist-a*sin(hh1/2)*5/6+(real(z)-.5*5/6)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/6+(real(z)-.5*1/6)*tan(hh1/2) &&\ imag(z)>a*sin(hh1/2)*1/6-(real(z)-.5*1/6)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*5/6+(real(z)-.5*5/6)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/6+(real(z)-.5*1/6)*tan(hh1/2) &&\ imag(z).5*5/6 && fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if real(z)<.5*4/6 && imag(z)>-a*sin(hh1/2)*1/6+(real(z)-.5*1/6)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if real(z)>.5*4/6 && real(z)<.5*5/6 && imag(z)>a*sin(hh1/2)*1/6-(real(z)-.5*1/6)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif endif ; voor var=1 endif ; voor @pat=9 ;----------------------------------------- if @pat==10 cnt=1 while cnt<19 if cnt==1 && (fh==0) pt1=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*7/8) pt2=0 elseif cnt==2 && (fh==1 ) pt1=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*7/8) pt2=0 elseif cnt==3 && (fh==0) pt1=a*(cos(hh1/2)*9/8+i*sin(hh1/2)*9/8) pt2=a*(cos(hh1/2)*1/8+i*sin(hh1/2)*1/8) elseif cnt==4 && (fh==1 ) pt1=a*(cos(hh1/2)*9/8-i*sin(hh1/2)*9/8) pt2=a*(cos(hh1/2)*1/8-i*sin(hh1/2)*1/8) elseif cnt==5 && (fh==0) pt1=a*(cos(hh1/2)*1/8+i*sin(hh1/2)*1/8) pt2=a*(cos(hh1/2)*6/8-i*sin(hh1/2)*4/8) elseif cnt==6 && (fh==1) pt1=a*(cos(hh1/2)*1/8-i*sin(hh1/2)*1/8) pt2=a*(cos(hh1/2)*6/8+i*sin(hh1/2)*4/8) elseif cnt==7 && (fh==0) pt1=a*(cos(hh1/2)*6/8+i*sin(hh1/2)*2/8) pt2=a*(cos(hh1/2)*6/8-i*sin(hh1/2)*4/8) elseif cnt==8 && (fh==1) pt1=a*(cos(hh1/2)*6/8-i*sin(hh1/2)*2/8) pt2=a*(cos(hh1/2)*6/8+i*sin(hh1/2)*4/8) elseif cnt==9 && (fh==0) pt1=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*7/8) pt2=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*3/8) elseif cnt==10 && (fh==1) pt1=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*7/8) pt2=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*3/8) elseif cnt==11 && (fh==0) pt1=a*(cos(hh1/2)*4/8-i*sin(hh1/2)*0/8) pt2=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*3/8) elseif cnt==12 && (fh==1) pt1=a*(cos(hh1/2)*4/8-i*sin(hh1/2)*0/8) pt2=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*3/8) elseif cnt==13 && (fh==0) pt1=a*(cos(hh1/2)*3/8+i*sin(hh1/2)*1/8) pt2=a*(cos(hh1/2)*6/8-i*sin(hh1/2)*2/8) elseif cnt==14 && (fh==1) pt1=a*(cos(hh1/2)*3/8-i*sin(hh1/2)*1/8) pt2=a*(cos(hh1/2)*6/8+i*sin(hh1/2)*2/8) elseif cnt==15 && (fh==0) pt1=a*(cos(hh1/2)*3/8+i*sin(hh1/2)*1/8) pt2=a*(cos(hh1/2)*9/8+i*sin(hh1/2)*7/8) elseif cnt==16 && (fh==1) pt1=a*(cos(hh1/2)*3/8-i*sin(hh1/2)*1/8) pt2=a*(cos(hh1/2)*9/8-i*sin(hh1/2)*7/8) elseif cnt==17 && (fh==0) pt1=a*(cos(hh1/2)*8/8-i) pt2=a*(cos(hh1/2)*8/8+i*sin(hh1/2)*6/8) elseif cnt==18 && (fh==1) pt1=a*(cos(hh1/2)*8/8+i) pt2=a*(cos(hh1/2)*8/8-i*sin(hh1/2)*6/8) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist.5*7/8 && imag(z)<-a*sin(hh1/2)*1/8+(real(z)-.5*1/8)*tan(hh1/2) && fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if real(z)>.5*7/8 && imag(z)>a*sin(hh1/2)*1/8-(real(z)-.5*1/8)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/8+(real(z)-.5*1/8)*tan(hh1/2) &&\ imag(z)>a*sin(hh1/2)*1/8-(real(z)-.5*1/8)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)-a*sin(hh1/2)*1/8+(real(z)-.5*1/8)*tan(hh1/2) && real(z)<.5*7/8 && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if real(z)>.5*6/8 && real(z)<.5*7/8 && imag(z)<-a*sin(hh1/2)*2/8+(real(z)-.5*2/8)*tan(hh1/2)\ && imag(z)>a*sin(hh1/2)*1/8-(real(z)-.5*1/8)*tan(hh1/2) && fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if real(z)>.5*6/8 && real(z)<.5*7/8 && imag(z)>a*sin(hh1/2)*2/8-(real(z)-.5*2/8)*tan(hh1/2)\ && imag(z)<-a*sin(hh1/2)*1/8+(real(z)-.5*1/8)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if real(z)<.5*6/8 && imag(z)a*sin(hh1/2)*1/8-(real(z)-.5*1/8)*tan(hh1/2) && fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if real(z)<.5*6/8 && imag(z)>-a*sin(hh1/2)*2/8+(real(z)-.5*2/8)*tan(hh1/2)\ && imag(z)<-a*sin(hh1/2)*1/8+(real(z)-.5*1/8)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if real(z)<.5*7/8 && imag(z)>-a*sin(hh1/2)*2/8+(real(z)-.5*2/8)*tan(hh1/2)\ && imag(z)<-a*sin(hh1/2)*1/8+(real(z)-.5*1/8)*tan(hh1/2)\ && imag(z)>a*sin(hh1/2)*2/8-(real(z)-.5*2/8)*tan(hh1/2) && fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if real(z)<.5*7/8 && imag(z)a*sin(hh1/2)*1/8-(real(z)-.5*1/8)*tan(hh1/2)\ && imag(z)<-a*sin(hh1/2)*2/8+(real(z)-.5*2/8)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif endif ; voor var=1 endif ; voor @pat=10 ;----------------------------------------- if @pat==11 cnt=1 while cnt<70 if cnt==1 && (hh%6==0) pt1=a*(cos(hh1/2)*2/6+i*sin(hh1/2)*2/6) pt2=a*(cos(hh1/2)*7/6+i*sin(hh1/2)*7/6) elseif cnt==2 && (hh%6==1) pt1=a*(cos(hh1/2)*2/6-i*sin(hh1/2)*2/6) pt2=a*(cos(hh1/2)*7/6-i*sin(hh1/2)*7/6) elseif cnt==3 && (hh%6==0) pt1=a*(cos(hh1/2)*2.25/6+i*sin(hh1/2)*1.75/6) pt2=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*5.5/6) elseif cnt==4 && (hh%6==0) pt1=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*4/6) pt2=a*(cos(hh1/2)*6/6-i) elseif cnt==5 && (hh%6==3) pt1=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*4/6) pt2=a*(cos(hh1/2)*6/6+i) elseif cnt==6 && (hh%6==0) pt1=a*(cos(hh1/2)*2/6+i*sin(hh1/2)*2/6) pt2=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*1/6) elseif cnt==7 && (hh%6==0) pt1=a*(cos(hh1/2)*3/6-i*sin(hh1/2)*3/6) pt2=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*1/6) elseif cnt==8 && (hh%6==0) pt1=a*(cos(hh1/2)*3/6-i*sin(hh1/2)*3.5/6) pt2=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*1.5/6) elseif cnt==9 && (hh%6==0) pt1=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*1/6) pt2=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*1.5/6) elseif cnt==10 && (hh%6==1) pt1=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*0/6) pt2=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*2/6) elseif cnt==11 && (hh%6==4) pt1=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*0/6) pt2=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*2/6) elseif cnt==12 && (hh%6==1) pt1=a*(cos(hh1/2)*5/6+i*sin(hh1/2)*5/6) pt2=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*6/6) elseif cnt==13 && (hh%6==1) pt1=a*(cos(hh1/2)*3/6+i*sin(hh1/2)*1/6) pt2=a*(cos(hh1/2)*3/6+i) elseif cnt==14 && (hh%6==1) pt1=a*(cos(hh1/2)*2.75/6+i*sin(hh1/2)*1.25/6) pt2=a*(cos(hh1/2)*2.75/6+i) elseif cnt==15 && (hh%6==1) pt1=a*(cos(hh1/2)*3/6+i*sin(hh1/2)*3/6) pt2=a*(cos(hh1/2)*2.75/6+i*sin(hh1/2)*2.75/6) elseif cnt==16 && (hh%6==1) pt1=a*(cos(hh1/2)*3/6-i*sin(hh1/2)*3/6) pt2=a*(cos(hh1/2)*2.75/6-i*sin(hh1/2)*2.75/6) elseif cnt==17 && (hh%6==1) pt1=a*(cos(hh1/2)*2/6+i*sin(hh1/2)*2/6) pt2=a*(cos(hh1/2)*3/6+i*sin(hh1/2)*1/6) elseif cnt==18 && (hh%6==3) pt1=a*(cos(hh1/2)*4/6-i*sin(hh1/2)*2/6) pt2=a*(cos(hh1/2)*4/6+i) elseif cnt==19 && (hh%6==3) pt1=a*(cos(hh1/2)*4/6-i*sin(hh1/2)*2/6) pt2=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*4/6) elseif cnt==20 && (hh%6==2) pt1=a*(cos(hh1/2)*2/6+i*sin(hh1/2)*2/6) pt2=0 elseif cnt==21 && (hh%6==3) pt1=a*(cos(hh1/2)*2/6-i*sin(hh1/2)*2/6) pt2=0 elseif cnt==22 && (hh%6==2) pt1=a*(cos(hh1/2)*2/6+i) pt2=a*(cos(hh1/2)*2/6-i) elseif cnt==23 && (hh%6==2) pt1=a*(cos(hh1/2)*2.75/6+i) pt2=a*(cos(hh1/2)*2.75/6-i) elseif cnt==24 && (hh%6==2) pt1=a*(cos(hh1/2)*3/6+i) pt2=a*(cos(hh1/2)*3/6-i) elseif cnt==25 && (hh%6==2) pt1=a*(cos(hh1/2)*5/6+i*sin(hh1/2)*1/6) pt2=a*(cos(hh1/2)*5/6-i) elseif cnt==26 && (hh%6==5) pt1=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*2/6) pt2=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*4/6) elseif cnt==27 && (hh%6==3) pt1=a*(cos(hh1/2)*.25/6+i*sin(hh1/2)*.25/6) pt2=a*(cos(hh1/2)*2/6-i*sin(hh1/2)*1.5/6) elseif cnt==28 && (hh%6==3) pt1=a*(cos(hh1/2)*2/6-i) pt2=a*(cos(hh1/2)*2/6-i*sin(hh1/2)*1.5/6) elseif cnt==29 && (hh%6==3) pt1=a*(cos(hh1/2)*3/6-i*sin(hh1/2)*2.5/6) pt2=a*(cos(hh1/2)*2.75/6-i*sin(hh1/2)*2.75/6) elseif cnt==30 && (hh%6==3) pt1=a*(cos(hh1/2)*3/6-i*sin(hh1/2)*2.5/6) pt2=a*(cos(hh1/2)*3/6+i) elseif cnt==31 && (hh%6==3) pt1=a*(cos(hh1/2)*3/6-i*sin(hh1/2)*3/6) pt2=a*(cos(hh1/2)*4/6-i*sin(hh1/2)*2/6) elseif cnt==32 && (hh%6==3) pt1=a*(cos(hh1/2)*5.25/6-i*sin(hh1/2)*4.75/6) pt2=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*5.5/6) elseif cnt==33 && (hh%6==4) pt1=a*(cos(hh1/2)*.25/6-i) pt2=a*(cos(hh1/2)*.25/6+i) elseif cnt==34 && (hh%6==4) pt1=a*(cos(hh1/2)*1/6+i*sin(hh1/2)*1/6) pt2=a*(cos(hh1/2)*3/6-i*sin(hh1/2)*1/6) elseif cnt==35 && (hh%6==4) pt1=a*(cos(hh1/2)*3/6+i) pt2=a*(cos(hh1/2)*3/6-i*sin(hh1/2)*1/6) elseif cnt==36 && (hh%6==4) pt1=a*(cos(hh1/2)*3.25/6+i) pt2=a*(cos(hh1/2)*3.25/6-i*sin(hh1/2)*.75/6) elseif cnt==37 && (hh%6==4) pt1=a*(cos(hh1/2)*3/6-i*sin(hh1/2)*1/6) pt2=a*(cos(hh1/2)*3.25/6-i*sin(hh1/2)*.75/6) elseif cnt==38 && (hh%6==4) pt1=a*(cos(hh1/2)*4/6+i*sin(hh1/2)*4/6) pt2=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*2/6) elseif cnt==39 && (hh%6==4) pt1=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*0/6) pt2=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*2/6) elseif cnt==40 && (hh%6==1) pt1=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*0/6) pt2=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*2/6) elseif cnt==41 && (hh%6==4) pt1=a*(cos(hh1/2)*4/6-i*sin(hh1/2)*4/6) pt2=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*2/6) elseif cnt==42 && (hh%6==4) pt1=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*0/6) pt2=a*(cos(hh1/2)*3/6-i*sin(hh1/2)*3/6) elseif cnt==43 && (hh%6==1) pt1=a*(cos(hh1/2)*5/6+i*sin(hh1/2)*1/6) pt2=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*2/6) elseif cnt==44 && (hh%6==5) pt1=a*(cos(hh1/2)*3/6-i*sin(hh1/2)*3/6) pt2=a*(cos(hh1/2)*4/6-i*sin(hh1/2)*2/6) elseif cnt==45 && (hh%6==5) pt1=a*(cos(hh1/2)*4/6-i) pt2=a*(cos(hh1/2)*4/6-i*sin(hh1/2)*2/6) elseif cnt==46 && (hh%6==5) pt1=a*(cos(hh1/2)*3.25/6-i*sin(hh1/2)*3.25/6) pt2=a*(cos(hh1/2)*4/6-i*sin(hh1/2)*2.5/6) elseif cnt==47 && (hh%6==5) pt1=a*(cos(hh1/2)*.25/6-i*sin(hh1/2)*.25/6) pt2=a*(cos(hh1/2)*1/6+i*sin(hh1/2)*.5/6) elseif cnt==48 && (hh%6==5) pt1=a*(cos(hh1/2)*1/6+i*sin(hh1/2)*1/6) pt2=0 elseif cnt==49 && (hh%6==0) pt1=a*(cos(hh1/2)*1/6-i*sin(hh1/2)*1/6) pt2=0 elseif cnt==50 && (hh%6==5) pt1=a*(cos(hh1/2)*1/6-i) pt2=a*(cos(hh1/2)*1/6+i) elseif cnt==52 && (hh%6==5) pt1=a*(cos(hh1/2)*3/6+i*sin(hh1/2)*1/6) pt2=a*(cos(hh1/2)*3/6+i) elseif cnt==53 && (hh%6==5) pt1=a*(cos(hh1/2)*3.25/6+i*sin(hh1/2)*1.25/6) pt2=a*(cos(hh1/2)*3.25/6+i) elseif cnt==54 && (hh%6==5) pt1=a*(cos(hh1/2)*3/6+i*sin(hh1/2)*1/6) pt2=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*4/6) elseif cnt==55 && (hh%6==2) pt1=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*2/6) pt2=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*4/6) elseif cnt==56 && (hh%6==2) pt1=a*(cos(hh1/2)*5/6+i*sin(hh1/2)*1/6) pt2=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*2/6) elseif cnt==57 && (hh%6==2) pt1=a*(cos(hh1/2)*5.75/6+i*sin(hh1/2)*1.75/6) pt2=a*(cos(hh1/2)*5.75/6-i*sin(hh1/2)*3.75/6) elseif cnt==58 && (hh%6==2) pt1=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*4/6) pt2=a*(cos(hh1/2)*5.75/6-i*sin(hh1/2)*3.75/6) elseif cnt==59 && (hh%6==2) pt1=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*5/6) pt2=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*6/6) elseif cnt==60 && (hh%6==1) pt1=a*(cos(hh1/2)*5/6+i*sin(hh1/2)*5/6) pt2=a*(cos(hh1/2)*5/6+i*sin(hh1/2)*1/6) elseif cnt==61 && (hh%6==1) pt1=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*0/6) pt2=a*(cos(hh1/2)*5/6+i*sin(hh1/2)*1/6) elseif cnt==62 && (hh%6==3) pt1=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*5/6) pt2=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*4/6) elseif cnt==63 && (hh%6==3) pt1=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*5/6) pt2=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*6/6) elseif cnt==64 && (hh%6==2) pt1=a*(cos(hh1/2)*5/6+i*sin(hh1/2)*5/6) pt2=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*6/6) elseif cnt==65 && (hh%6==0) pt1=a*(cos(hh1/2)*6/6+i*sin(hh1/2)*5.5/6) pt2=a*(cos(hh1/2)*6/6+i) elseif cnt==66 && (hh%6==3) pt1=a*(cos(hh1/2)*6/6-i*sin(hh1/2)*5.5/6) pt2=a*(cos(hh1/2)*6/6-i) elseif cnt==67 && (hh%6==5) pt1=a*(cos(hh1/2)*5/6+i*sin(hh1/2)*7/6) pt2=a*(cos(hh1/2)*7/6+i*sin(hh1/2)*5/6) elseif cnt==68 && (hh%6==4) pt1=a*(cos(hh1/2)*5/6-i*sin(hh1/2)*7/6) pt2=a*(cos(hh1/2)*7/6-i*sin(hh1/2)*5/6) elseif cnt==69 && (hh%6==1||hh%6==4) pt1=i pt2=-i endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist-a*sin(hh1/2)*3/6+(real(z)-.5*3/6)*tan(hh1/2) && hh%6==0 c=@clrvlak3+.5 endif if imag(z)<-a*sin(hh1/2)*3/6+(real(z)-.5*3/6)*tan(hh1/2) &&\ imag(z)>-a*sin(hh1/2)*3.25/6+(real(z)-.5*3.25/6)*tan(hh1/2) && real(z)<.5*5/6 && hh%6==0 c=@clrvlak2+.5 endif if imag(z)>a*sin(hh1/2)*2/6-(real(z)-.5*2/6)*tan(hh1/2) &&\ imag(z)>-a*sin(hh1/2)*.25/6+(real(z)-.5*.25/6)*tan(hh1/2) && hh%6==0 c=@clrvlak2+.5 endif if imag(z).5*3/6 && hh%6==1 c=@clrvlak3+.5 endif if imag(z)>a*sin(hh1/2)*2/6-(real(z)-.5*2/6)*tan(hh1/2) && real(z)>.5*2.75/6\ && real(z)<.5*3/6 && hh%6==1 c=@clrvlak1+.5 endif if real(z)>.5*3/6 && real(z)<.5*5/6 && hh%6==1 c=@clrvlak3+.5 endif if real(z)<.5*2/6 && hh%6==2 c=@clrvlak3+.5 endif if real(z)<.5*3/6 && real(z)>.5*2.75/6 && hh%6==2 c=@clrvlak2+.5 endif if real(z)>.5*3/6 && real(z)<.5*5/6 && hh%6==2 c=@clrvlak3+.5 endif if real(z)>.5*5/6 && imag(z)>-a*sin(hh1/2)*2/6+(real(z)-.5*2/6)*tan(hh1/2) && hh%6==2 c=@clrvlak3+.5 endif if real(z)>.5*5.75/6 && imag(z)<-a*sin(hh1/2)*2/6+(real(z)-.5*2/6)*tan(hh1/2) &&\ imag(z)>a*sin(hh1/2)*1/6-(real(z)-.5*1/6)*tan(hh1/2) && hh%6==2 c=@clrvlak2+.5 endif if imag(z)-a*sin(hh1/2)*5/6+(real(z)-.5*5/6)*tan(hh1/2) && hh%6==3 c=@clrvlak3+.5 endif if real(z)>.5*3/6 && real(z)<.5*4/6 &&\ imag(z)>-a*sin(hh1/2)*3/6+(real(z)-.5*3/6)*tan(hh1/2) && hh%6==3 c=@clrvlak2+.5 endif if real(z)>.5*4/6 && \ imag(z)>a*sin(hh1/2)*1/6-(real(z)-.5*1/6)*tan(hh1/2) && hh%6==3 c=@clrvlak1+.5 endif if real(z)<.5*.25/6 && hh%6==4 c=@clrvlak1+.5 endif if (real(z)<.5*3.25/6 && real(z)>.5*3/6) &&\ imag(z)>-a*sin(hh1/2)*2/6+(real(z)-.5*2/6)*tan(hh1/2) && hh%6==4 c=@clrvlak1+.5 endif if real(z)<.5*3/6 &&\ imag(z)>a*sin(hh1/2)*1/6-(real(z)-.5*1/6)*tan(hh1/2) && hh%6==4 c=@clrvlak3+.5 endif if imag(z)<-a*sin(hh1/2)*3/6+(real(z)-.5*3/6)*tan(hh1/2) &&\ imag(z)>-a*sin(hh1/2)*4/6+(real(z)-.5*4/6)*tan(hh1/2) && hh%6==4 c=@clrvlak2+.5 endif if imag(z)<-a*sin(hh1/2)*4/6+(real(z)-.5*4/6)*tan(hh1/2) && hh%6==4 c=@clrvlak1+.5 endif if imag(z)>a*sin(hh1/2)*4/6-(real(z)-.5*4/6)*tan(hh1/2) && hh%6==4 c=@clrvlak3+.5 endif ; if imag(z)>-a*sin(hh1/2)*5/6+(real(z)-.5*5/6)*tan(hh1/2) &&\ ; imag(z)<-a*sin(hh1/2)*3/6+(real(z)-.5*3/6)*tan(hh1/2) && hh%6==4 ; c=@clrvlak1+.5 ; endif ; if imag(z)<-a*sin(hh1/2)*2.75/6+(real(z)-.5*2.75/6)*tan(hh1/2) &&\ ; imag(z)>-a*sin(hh1/2)*3/6+(real(z)-.5*3/6)*tan(hh1/2) && hh%6==4 ; c=@clrvlak2+.5 ; endif if real(z)<.5*1/6 && imag(z)>-a*sin(hh1/2)*.25/6+(real(z)-.5*.25/6)*tan(hh1/2) &&hh%6==5 c=@clrvlak1+.5 endif if real(z)<.5*4/6 && imag(z)<-a*sin(hh1/2)*3/6+(real(z)-.5*3/6)*tan(hh1/2) &&\ imag(z)>-a*sin(hh1/2)*3.25/6+(real(z)-.5*3.25/6)*tan(hh1/2) &&hh%6==5 c=@clrvlak1+.5 endif if (real(z)<.5*3/6 && real(z)>.5*1/6) && hh%6==5 c=@clrvlak3+.5 endif if real(z)<.5*4/6 && real(z)>.5*3/6 &&imag(z)<-a*sin(hh1/2)*1/6+(real(z)-.5*1/6)*tan(hh1/2) &&\ imag(z)>-a*sin(hh1/2)*3/6+(real(z)-.5*3/6)*tan(hh1/2) &&hh%6==5 c=@clrvlak3+.5 endif if real(z)>.5*4/6 &&imag(z)<-a*sin(hh1/2)*1/6+(real(z)-.5*1/6)*tan(hh1/2) \ &&hh%6==5 c=@clrvlak3+.5 endif if real(z)>.5*3/6 &&real(z)<.5*3.25/6 &&imag(z)>-a*sin(hh1/2)*1/6+(real(z)-.5*1/6)*tan(hh1/2) \ &&hh%6==5 c=@clrvlak2+.5 endif if imag(z)<-a*sin(hh1/2)*2/6+(real(z)-.5*2/6)*tan(hh1/2) \ &&imag(z)>a*sin(hh1/2)*3/6-(real(z)-.5*3/6)*tan(hh1/2) &&hh%6==1 c=@clrvlak2+.5 endif if imag(z)>-a*sin(hh1/2)*2/6+(real(z)-.5*2/6)*tan(hh1/2) \ && real(z)>.5*5/6 &&hh%6==1 c=@clrvlak1+.5 endif if imag(z)<-a*sin(hh1/2)*2.75/6+(real(z)-.5*2.75/6)*tan(hh1/2) \ && real(z)<.5*3/6 &&hh%6==3 c=@clrvlak2+.5 endif endif ; voor var=1 endif ; voor @pat=11 ;----------------------------------------- if @pat==12 cnt=1 while cnt<69 if cnt==1 && (fh==0) pt1=a*(cos(hh1/2)*1+i*sin(hh1/2)*.4) pt2=a*(cos(hh1/2)*1+i*sin(hh1/2)*.6) elseif cnt==2 && (fh==0) pt1=a*(cos(hh1/2)*1-i*sin(hh1/2)*.6) pt2=a*(cos(hh1/2)*1-i*sin(hh1/2)*.8) elseif cnt==3 && (fh==1) pt1=a*(cos(hh1/2)*1-i*sin(hh1/2)*.4) pt2=a*(cos(hh1/2)*1-i*sin(hh1/2)*.6) elseif cnt==4 && (fh==1) pt1=a*(cos(hh1/2)*1+i*sin(hh1/2)*.6) pt2=a*(cos(hh1/2)*1+i*sin(hh1/2)*.8) elseif cnt==5 && (fh==0) pt1=a*(cos(hh1/2)*.1-i*sin(hh1/2)*.1) pt2=a*(cos(hh1/2)*.2-i*sin(hh1/2)*.2) elseif cnt==6 && (fh==0) pt1=a*(cos(hh1/2)*.7-i*sin(hh1/2)*.7) pt2=a*(cos(hh1/2)*.8-i*sin(hh1/2)*.8) elseif cnt==7 && (fh==1) pt1=a*(cos(hh1/2)*.1+i*sin(hh1/2)*.1) pt2=a*(cos(hh1/2)*.2+i*sin(hh1/2)*.2) elseif cnt==8 && (fh==1) pt1=a*(cos(hh1/2)*.7+i*sin(hh1/2)*.7) pt2=a*(cos(hh1/2)*.8+i*sin(hh1/2)*.8) elseif cnt==9 && (fh==0) pt1=a*(cos(hh1/2)*.2+i*sin(hh1/2)*.2) pt2=a*(cos(hh1/2)*.3+i*sin(hh1/2)*.3) elseif cnt==10 && (fh==0) pt1=a*(cos(hh1/2)*.8+i*sin(hh1/2)*.8) pt2=a*(cos(hh1/2)*.9+i*sin(hh1/2)*.9) elseif cnt==11 && (fh==1) pt1=a*(cos(hh1/2)*.2-i*sin(hh1/2)*.2) pt2=a*(cos(hh1/2)*.3-i*sin(hh1/2)*.3) elseif cnt==12 && (fh==1) pt1=a*(cos(hh1/2)*.8-i*sin(hh1/2)*.8) pt2=a*(cos(hh1/2)*.9-i*sin(hh1/2)*.9) elseif cnt==13 pt1=a*(cos(hh1/2)*.1+i*sin(hh1/2)*.1) pt2=a*(cos(hh1/2)*.2+i*sin(hh1/2)*.0) elseif cnt==14 pt1=a*(cos(hh1/2)*.4-i*sin(hh1/2)*.2) pt2=a*(cos(hh1/2)*1.0-i*sin(hh1/2)*.8) elseif cnt==15 pt1=a*(cos(hh1/2)*.2+i*sin(hh1/2)*.2) pt2=a*(cos(hh1/2)*.3+i*sin(hh1/2)*.1) elseif cnt==16 pt1=a*(cos(hh1/2)*.5-i*sin(hh1/2)*.1) pt2=a*(cos(hh1/2)*1.-i*sin(hh1/2)*.6) elseif cnt==17 pt1=a*(cos(hh1/2)*.3+i*sin(hh1/2)*.3) pt2=a*(cos(hh1/2)*.4+i*sin(hh1/2)*.2) elseif cnt==18 pt1=a*(cos(hh1/2)*.6+i*sin(hh1/2)*.0) pt2=a*(cos(hh1/2)*1.-i*sin(hh1/2)*.4) elseif cnt==20 pt1=a*(cos(hh1/2)*.1-i*sin(hh1/2)*.1) pt2=a*(cos(hh1/2)*.7+i*sin(hh1/2)*.5) elseif cnt==21 pt1=a*(cos(hh1/2)*.9+i*sin(hh1/2)*.7) pt2=a*(cos(hh1/2)*1.+i*sin(hh1/2)*.8) elseif cnt==22 pt1=a*(cos(hh1/2)*.2-i*sin(hh1/2)*.2) pt2=a*(cos(hh1/2)*.7+i*sin(hh1/2)*.3) elseif cnt==23 pt1=a*(cos(hh1/2)*.9+i*sin(hh1/2)*.5) pt2=a*(cos(hh1/2)*1.+i*sin(hh1/2)*.6) elseif cnt==24 pt1=a*(cos(hh1/2)*.3-i*sin(hh1/2)*.3) pt2=a*(cos(hh1/2)*.7+i*sin(hh1/2)*.1) elseif cnt==25 pt1=a*(cos(hh1/2)*.9+i*sin(hh1/2)*.3) pt2=a*(cos(hh1/2)*1.+i*sin(hh1/2)*.4) elseif cnt==26 pt1=a*(cos(hh1/2)*.7-i) pt2=a*(cos(hh1/2)*.7-i*sin(hh1/2)*.5) elseif cnt==27 pt1=a*(cos(hh1/2)*.7+i) pt2=a*(cos(hh1/2)*.7-i*sin(hh1/2)*.1) elseif cnt==28 pt1=a*(cos(hh1/2)*.8-i) pt2=a*(cos(hh1/2)*.8-i*sin(hh1/2)*.6) elseif cnt==29 pt1=a*(cos(hh1/2)*.8+i) pt2=a*(cos(hh1/2)*.8-i*sin(hh1/2)*.2) elseif cnt==30 pt1=a*(cos(hh1/2)*.9-i) pt2=a*(cos(hh1/2)*.9-i*sin(hh1/2)*.7) elseif cnt==31 pt1=a*(cos(hh1/2)*.9+i) pt2=a*(cos(hh1/2)*.9-i*sin(hh1/2)*.3) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist.5*.8 && real(z)<.5*.9 && (imag(z)>a*sin(hh1/2)*.3-(real(z)-.5*.3)*tan(hh1/2)\ ||imag(z).5*.7 && real(z)<.5*.8 && (imag(z)>a*sin(hh1/2)*.3-(real(z)-.5*.3)*tan(hh1/2)\ ||imag(z).5*.9) && (imag(z)>-a*sin(hh1/2)*.2+(real(z)-.5*.2)*tan(hh1/2)\ && imag(z)<-a*sin(hh1/2)*.1+(real(z)-.5*.1)*tan(hh1/2)) IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==1 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if (real(z)<.5*.7 || real(z)>.5*.9) && (imag(z)>-a*sin(hh1/2)*.3+(real(z)-.5*.3)*tan(hh1/2)\ && imag(z)<-a*sin(hh1/2)*.2+(real(z)-.5*.2)*tan(hh1/2)) IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==1 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if (imag(z)>-a*sin(hh1/2)*.1+(real(z)-.5*.1)*tan(hh1/2) ||\ imag(z)<-a*sin(hh1/2)*.3+(real(z)-.5*.3)*tan(hh1/2)) && \ (imag(z)>a*sin(hh1/2)*.1-(real(z)-.5*.1)*tan(hh1/2)\ && imag(z)-a*sin(hh1/2)*.1+(real(z)-.5*.1)*tan(hh1/2) ||\ imag(z)<-a*sin(hh1/2)*.3+(real(z)-.5*.3)*tan(hh1/2)) && \ (imag(z)>a*sin(hh1/2)*.2-(real(z)-.5*.2)*tan(hh1/2)\ && imag(z)a*1/6 && cabs(z-(.5+i*a*sin(hh1/2)))a*4/6 && cabs(z-(.5-i*a*sin(hh1/2)))a*4/6 && cabs(z-(.5+i*a*sin(hh1/2)))a*1/6 && cabs(z-(.5-i*a*sin(hh1/2)))1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist.5*6/7 && imag(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*5/7+(real(z)-.5*5/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)<-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) &&real(z)>.5*5/7 \ &&real(z)<.5*6/7&& fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) && real(z)>.5*5/7 \ && imag(z)>-a*sin(hh1/2)*5/7+(real(z)-.5*5/7)*tan(hh1/2) && fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z).5*5/7 \ && imag(z)<-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z).5*6/7 \ && imag(z)>a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && real(z)<.5*6/7 && real(z)>.5*5/7\ && imag(z)>-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) \ && imag(z)>a*sin(hh1/2)*4/7-(real(z)-.5*4/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) \ && imag(z).5*5/7 &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) \ && imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)>.5*6/7 &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z).5*5/7\ && imag(z)>a*sin(hh1/2)*4/7-(real(z)-.5*4/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*5/7-(real(z)-.5*5/7)*tan(hh1/2) \ && imag(z)>-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z).5*3/7\ &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z).5*3/7\ && imag(z)>a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z).5*3/7\ && imag(z)>a*sin(hh1/2)*2/7-(real(z)-.5*2/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)<.5*5/7 && real(z)>.5*4/7\ &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)<.5*5/7 && real(z)>.5*4/7\ && imag(z)>a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if real(z)<.5*4/7 \ && imag(z)>a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if real(z)<.5*3/7 \ && imag(z)<-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)<.5*3/7 \ && imag(z)>-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)<.5*3/7 \ && fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) \ && imag(z).5*5/7||(real(z)>.5*3/7 && real(z)<.5*4/7)) && fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)>a*sin(hh1/2)*2/7-(real(z)-.5*2/7)*tan(hh1/2) \ && imag(z)<-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) \ && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)>-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) && real(z)>.5*6/7 \ && imag(z)<-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && real(z)>.5*6/7 \ && imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)>.5*6/7 \ && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*2/7-(real(z)-.5*2/7)*tan(hh1/2) && real(z)<.5*6/7 && real(z)>.5*5/7\ && imag(z)a*sin(hh1/2)*4/7-(real(z)-.5*4/7)*tan(hh1/2) && real(z)<.5*6/7 \ && imag(z)a*sin(hh1/2)*5/7-(real(z)-.5*5/7)*tan(hh1/2) && real(z)<.5*6/7 \ && fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) && real(z)<.5*5/7 \ && imag(z)<-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && real(z)<.5*5/7 && real(z)>.5*4/7\ && imag(z)<-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) && real(z)<.5*5/7 && real(z)>.5*4/7\ && imag(z)-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*2/7-(real(z)-.5*2/7)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && \ real(z)<.5*3/7 && real(z)>.5*2/7 && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)>a*sin(hh1/2)*2/7-(real(z)-.5*2/7)*tan(hh1/2) && real(z)<.5*3/7 && fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && \ real(z)<.5*4/7 && \ real(z)>.5*3/7 && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif endif ; voor var=1 endif ; voor @pat=14 ;----------------------------------------- if @pat==15 cnt=1 while cnt<68 if cnt==1 && (hh%6==0 || hh%6==2 ) pt1=a*(cos(hh1/2)*4/4-i) pt2=a*(cos(hh1/2)*4/4-i*sin(hh1/2)*2/4) elseif cnt==2 && (hh%6==3 || hh%6==5 ) pt1=a*(cos(hh1/2)*4/4+i) pt2=a*(cos(hh1/2)*4/4+i*sin(hh1/2)*2/4) elseif cnt==3 && (hh%6==1) pt1=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*5/4) pt2=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*3/4) elseif cnt==4 && (hh%6==4) pt1=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*5/4) pt2=a*(cos(hh1/2)*5/4-i*sin(hh1/2)*3/4) elseif cnt==5 && (hh%6==0) pt1=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*5/4-i*sin(hh1/2)*5/4) elseif cnt==6 && (hh%6==5) pt1=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*5/4) elseif cnt==7 && (hh%6==0) pt1=0 pt2=a*(cos(hh1/2)*1/4+i*sin(hh1/2)*1/4) elseif cnt==8 && (hh%6==1) pt1=0 pt2=a*(cos(hh1/2)*1/4-i*sin(hh1/2)*1/4) elseif cnt==9 && (hh%6==0) pt1=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*5/4) elseif cnt==10 && (hh%6==1) pt1=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*5/4-i*sin(hh1/2)*5/4) elseif cnt==11 && (hh%6==0) pt1=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*1/4) elseif cnt==12 && (hh%6==0) pt1=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*1/4) elseif cnt==13 && (hh%6==0) pt1=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*1/4) elseif cnt==14 && (hh%6==0) pt1=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*1/4) elseif cnt==15 && (hh%6==0) pt1=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*5/4-i*sin(hh1/2)*3/4) elseif cnt==16 && (hh%6==0) pt1=a*(cos(hh1/2)*1/4+i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*0/4) elseif cnt==17 && (hh%6==0) pt1=a*(cos(hh1/2)*2/4-i) pt2=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*0/4) elseif cnt==18 && (hh%6==1) pt1=a*(cos(hh1/2)*1/4-i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*0/4) elseif cnt==19 && (hh%6==1) pt1=a*(cos(hh1/2)*1/4+i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*0/4) elseif cnt==20 && (hh%6==1) pt1=a*(cos(hh1/2)*2/4+i) pt2=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*0/4) elseif cnt==21 && (hh%6==1 || hh%6==3) pt1=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*2/4) elseif cnt==22 && (hh%6==2 || hh%6==4) pt1=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*2/4) elseif cnt==23 && (hh%6==1 ) pt1=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) elseif cnt==24 && (hh%6==1 ) pt1=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) elseif cnt==25 && (hh%6==1 ) pt1=a*(cos(hh1/2)*5/4-i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) elseif cnt==26 && (hh%6==1 ) pt1=a*(cos(hh1/2)*4/4-i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*4/4+i*sin(hh1/2)*2/4) elseif cnt==27 && (hh%6==4 ) pt1=a*(cos(hh1/2)*4/4-i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*4/4+i*sin(hh1/2)*2/4) elseif cnt==28 && (hh%6==1 ) pt1=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*4/4+i*sin(hh1/2)*2/4) elseif cnt==29 && (hh%6==2 ||hh%6==4 ) pt1=a*(cos(hh1/2)*1/4+i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*2/4) elseif cnt==30 && (hh%6==3 ||hh%6==5) pt1=a*(cos(hh1/2)*1/4-i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*2/4) elseif cnt==31 && (hh%6==2 ||hh%6==4 ) pt1=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*5/4) elseif cnt==32 && (hh%6==3 ||hh%6==5) pt1=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*5/4-i*sin(hh1/2)*5/4) elseif cnt==33 && (hh%6==2 ) pt1=a*(cos(hh1/2)*1/4+i) pt2=a*(cos(hh1/2)*1/4-i) elseif cnt==34 && (hh%6==2 ) pt1=a*(cos(hh1/2)*2/4+i) pt2=a*(cos(hh1/2)*2/4-i) elseif cnt==35 && (hh%6==2 ) pt1=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*1/4) elseif cnt==36 && (hh%6==2 ) pt1=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*1/4) elseif cnt==37 && (hh%6==2 ) pt1=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*1/4) elseif cnt==38 && (hh%6==2 ) pt1=a*(cos(hh1/2)*5/4-i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) elseif cnt==39 && (hh%6==2 ) pt1=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) elseif cnt==40 && (hh%6==3 ) pt1=0 pt2=a*(cos(hh1/2)*1/4+i*sin(hh1/2)*1/4) elseif cnt==41 && (hh%6==3 ) pt1=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*3/4) elseif cnt==42 && (hh%6==4 ) pt1=0 pt2=a*(cos(hh1/2)*1/4-i*sin(hh1/2)*1/4) elseif cnt==43 && (hh%6==4 ) pt1=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*3/4) elseif cnt==44 && (hh%6==3 ) pt1=a*(cos(hh1/2)*1/4-i) pt2=a*(cos(hh1/2)*1/4+i) elseif cnt==45 && (hh%6==3 ) pt1=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*0/4) elseif cnt==46 && (hh%6==3 ) pt1=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*0/4) elseif cnt==47 && (hh%6==3 ) pt1=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*0/4) elseif cnt==48 && (hh%6==3 ) pt1=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*1/4) elseif cnt==49 && (hh%6==3 ) pt1=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*3/4-i) elseif cnt==50 && (hh%6==3 ) pt1=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*5/4-i*sin(hh1/2)*1/4) elseif cnt==51 && (hh%6==4 ) pt1=a*(cos(hh1/2)*1/4+i) pt2=a*(cos(hh1/2)*1/4-i) elseif cnt==52 && (hh%6==4 ) pt1=a*(cos(hh1/2)*2/4+i) pt2=a*(cos(hh1/2)*2/4-i) elseif cnt==53 && (hh%6==4 ) pt1=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*1/4) elseif cnt==54 && (hh%6==4 ) pt1=a*(cos(hh1/2)*3/4-i) pt2=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*1/4) elseif cnt==55 && (hh%6==4 ) pt1=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*3/4) pt2=a*(cos(hh1/2)*3/4+i*sin(hh1/2)*1/4) elseif cnt==56 && (hh%6==4 ) pt1=a*(cos(hh1/2)*5/4-i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*3/4) elseif cnt==57 && (hh%6==5 ) pt1=a*(cos(hh1/2)*1/4-i) pt2=a*(cos(hh1/2)*1/4+i) elseif cnt==58 && (hh%6==5 ) pt1=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*5/4) elseif cnt==59 && (hh%6==5 ) pt1=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*2/4+i*sin(hh1/2)*0/4) elseif cnt==60 && (hh%6==1 ) pt1=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*2/4) pt2=a*(cos(hh1/2)*5/4-i*sin(hh1/2)*5/4) elseif cnt==61 && (hh%6==5 ) pt1=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*0/4) pt2=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*3/4) elseif cnt==62 && (hh%6==5 ) pt1=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*0/4) pt2=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) elseif cnt==63 && (hh%6==5 ) pt1=a*(cos(hh1/2)*5/4+i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) elseif cnt==64 && (hh%6==5 ) pt1=a*(cos(hh1/2)*3/4-i) pt2=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*1/4) elseif cnt==65 && (hh%6==5 ) pt1=a*(cos(hh1/2)*5/4-i*sin(hh1/2)*1/4) pt2=a*(cos(hh1/2)*3/4-i*sin(hh1/2)*3/4) elseif cnt==66 && (hh%6==0 ) pt1=a*(cos(hh1/2)*2/4-i*sin(hh1/2)*0/4) pt2=a*(cos(hh1/2)*1/4-i*sin(hh1/2)*1/4) elseif cnt==67 && (hh%6==2||hh%6==5 ) pt1=a*(cos(hh1/2)*0/4-i) pt2=a*(cos(hh1/2)*0/4+i) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==1 c=@clrvlak2+.5 endif endif if real(z)a*sin(hh1/2)*1/4-(real(z)-.5*1/4)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*2/4 IF hh%6==0 c=@clrvlak1+.5 endif endif if imag(z)a*cos(hh1/2)*3/4 IF hh%6==0 c=@clrvlak1+.5 endif endif if imag(z)>a*sin(hh1/2)*2/4-(real(z)-.5*2/4)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) IF hh%6==0 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*2/4+(real(z)-.5*2/4)*tan(hh1/2) && (real(z)>a*cos(hh1/2)*3/4||\ real(z)a*sin(hh1/2)*1/4-(real(z)-.5*1/4)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*2/4+(real(z)-.5*2/4)*tan(hh1/2) IF hh%6==0 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*1/4-(real(z)-.5*1/4)*tan(hh1/2) && real(z)-a*sin(hh1/2)*2/4+(real(z)-.5*2/4)*tan(hh1/2) && real(z)a*cos(hh1/2)*2/4 IF hh%6==1 c=@clrvlak1+.5 endif endif if imag(z)a*sin(hh1/2)*1/4-(real(z)-.5*1/4)*tan(hh1/2) && real(z)>a*cos(hh1/2)*3/4 IF hh%6==1 c=@clrvlak3+.5 endif endif if imag(z)a*sin(hh1/2)*3/4-(real(z)-.5*3/4)*tan(hh1/2) IF hh%6==1 c=@clrvlak2+.5 endif endif if real(z)a*cos(hh1/2)*1/4 IF hh%6==2 c=@clrvlak3+.5 endif endif if imag(z)a*cos(hh1/2)*2/4\ && real(z)a*sin(hh1/2)*2/4-(real(z)-.5*2/4)*tan(hh1/2)&& \ imag(z)>-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) IF hh%6==2 c=@clrvlak1+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/4+(real(z)-.5*2/4)*tan(hh1/2)&& \ imag(z)<-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) && real(z)>a*cos(hh1/2)*3/4 IF hh%6==2 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*2/4+(real(z)-.5*2/4)*tan(hh1/2)&& \ imag(z)>a*sin(hh1/2)*1/4-(real(z)-.5*1/4)*tan(hh1/2) IF hh%6==2 c=@clrvlak1+.5 endif endif if imag(z)a*cos(hh1/2)*3/4 IF hh%6==2 c=@clrvlak2+.5 endif endif if real(z)>a*cos(hh1/2)*2/4&& real(z)a*cos(hh1/2)*1/4&& real(z)a*cos(hh1/2)*2/4\ && imag(z)>-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) IF hh%6==3 c=@clrvlak2+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2)&& \ imag(z)>-a*sin(hh1/2)*2/4+(real(z)-.5*2/4)*tan(hh1/2) &&\ imag(z)>a*sin(hh1/2)*1/4-(real(z)-.5*1/4)*tan(hh1/2) IF hh%6==3 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*2/4+(real(z)-.5*2/4)*tan(hh1/2)&& \ imag(z)>-a*sin(hh1/2)*3/4+(real(z)-.5*3/4)*tan(hh1/2) &&\ real(z)>a*cos(hh1/2)*3/4 IF hh%6==3 c=@clrvlak2+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/4+(real(z)-.5*3/4)*tan(hh1/2) IF hh%6==3 c=@clrvlak3+.5 endif endif if real(z)>a*cos(hh1/2)*2/4 && real(z)a*cos(hh1/2)*1/4 && real(z)a*sin(hh1/2)*2/4-(real(z)-.5*2/4)*tan(hh1/2) \ && imag(z)>-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) IF hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*3/4+(real(z)-.5*3/4)*tan(hh1/2) && real(z)>a*cos(hh1/2)*3/4 \ && imag(z)<-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) IF hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/4+(real(z)-.5*3/4)*tan(hh1/2) IF hh%6==4 c=@clrvlak2+.5 endif endif if real(z)a*cos(hh1/2)*1/4 IF hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*2/4+(real(z)-.5*2/4)*tan(hh1/2) && \ imag(z)>a*sin(hh1/2)*1/4-(real(z)-.5*1/4)*tan(hh1/2) IF hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/4+(real(z)-.5*1/4)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*2/4 IF hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)a*cos(hh1/2)*2/4 && real(z)-a*sin(hh1/2)*3/4+(real(z)-.5*3/4)*tan(hh1/2) && real(z)>a*cos(hh1/2)*3/4 IF hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/4+(real(z)-.5*3/4)*tan(hh1/2) IF hh%6==5 c=@clrvlak1+.5 endif endif endif ; voor var=1 endif ; voor @pat=15 ;----------------------------------------- if @pat==16 cnt=1 while cnt<44 if cnt==1 && fh==0 pt1=a*(cos(hh1/2)*2/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*4/7-i*sin(hh1/2)*4/7) elseif cnt==2 && fh==1 pt1=a*(cos(hh1/2)*2/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*4/7+i*sin(hh1/2)*4/7) elseif cnt==3 && fh==0 pt1=a*(cos(hh1/2)*0/7-i*sin(hh1/2)*4/7) pt2=a*(cos(hh1/2)*3/7-i*sin(hh1/2)*1/7) elseif cnt==4 && fh==1 pt1=a*(cos(hh1/2)*0/7+i*sin(hh1/2)*4/7) pt2=a*(cos(hh1/2)*3/7+i*sin(hh1/2)*1/7) elseif cnt==5 && fh==0 pt1=a*(cos(hh1/2)*0/7-i*sin(hh1/2)*8/7) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*3/7) elseif cnt==6 && fh==1 pt1=a*(cos(hh1/2)*0/7+i*sin(hh1/2)*8/7) pt2=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*3/7) elseif cnt==7 && fh==0 pt1=a*(cos(hh1/2)*3/7-i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*3/7) elseif cnt==8 && fh==1 pt1=a*(cos(hh1/2)*3/7+i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*3/7) elseif cnt==9 pt1=a*(cos(hh1/2)*3/7-i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*3/7+i*sin(hh1/2)*1/7) elseif cnt==10 && fh==0 pt1=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*3/7) elseif cnt==11 && fh==1 pt1=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*3/7) elseif cnt==12 && fh==0 pt1=a*(cos(hh1/2)*3/7+i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*1/7) elseif cnt==13 && fh==1 pt1=a*(cos(hh1/2)*3/7-i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*1/7) elseif cnt==14 && fh==0 pt1=a*(cos(hh1/2)*3/7+i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*4/7+i*sin(hh1/2)*2/7) elseif cnt==15 && fh==1 pt1=a*(cos(hh1/2)*3/7-i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*4/7-i*sin(hh1/2)*2/7) elseif cnt==16 && fh==0 pt1=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*0/7) elseif cnt==17 && fh==1 pt1=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*1/7) pt2=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*0/7) elseif cnt==18 && fh==0 pt1=a*(cos(hh1/2)*4/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*0/7) elseif cnt==19 && fh==1 pt1=a*(cos(hh1/2)*4/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*0/7) elseif cnt==20 && fh==0 pt1=a*(cos(hh1/2)*4/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*4/7+i) elseif cnt==21 && fh==1 pt1=a*(cos(hh1/2)*4/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*4/7-i) elseif cnt==22 && fh==0 pt1=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*0/7) elseif cnt==23 && fh==1 pt1=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*0/7) elseif cnt==24 && fh==0 pt1=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*3/7) elseif cnt==25 && fh==1 pt1=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*3/7) elseif cnt==26 && fh==0 pt1=a*(cos(hh1/2)*5/7+i) pt2=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*3/7) elseif cnt==27 && fh==1 pt1=a*(cos(hh1/2)*5/7-i) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*3/7) elseif cnt==28 && fh==0 pt1=a*(cos(hh1/2)*8/7+i*sin(hh1/2)*6/7) pt2=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*3/7) elseif cnt==29 && fh==1 pt1=a*(cos(hh1/2)*8/7-i*sin(hh1/2)*6/7) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*3/7) elseif cnt==30 && fh==0 pt1=a*(cos(hh1/2)*8/7+i*sin(hh1/2)*8/7) pt2=a*(cos(hh1/2)*5/7+i*sin(hh1/2)*5/7) elseif cnt==31 && fh==1 pt1=a*(cos(hh1/2)*8/7-i*sin(hh1/2)*8/7) pt2=a*(cos(hh1/2)*5/7-i*sin(hh1/2)*5/7) elseif cnt==32 && fh==0 pt1=a*(cos(hh1/2)*7/7+i*sin(hh1/2)*7/7) pt2=a*(cos(hh1/2)*7/7+i*sin(hh1/2)*5/7) elseif cnt==33 && fh==1 pt1=a*(cos(hh1/2)*7/7-i*sin(hh1/2)*7/7) pt2=a*(cos(hh1/2)*7/7-i*sin(hh1/2)*5/7) elseif cnt==34 && fh==0 pt1=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*8/7+i*sin(hh1/2)*4/7) elseif cnt==35 && fh==1 pt1=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*8/7-i*sin(hh1/2)*4/7) elseif cnt==36 && fh==0 pt1=a*(cos(hh1/2)*7/7+i*sin(hh1/2)*3/7) pt2=a*(cos(hh1/2)*7/7-i*sin(hh1/2)*1/7) elseif cnt==37 && fh==1 pt1=a*(cos(hh1/2)*7/7-i*sin(hh1/2)*3/7) pt2=a*(cos(hh1/2)*7/7+i*sin(hh1/2)*1/7) elseif cnt==38 && fh==0 pt1=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*7/7-i*sin(hh1/2)*1/7) elseif cnt==39 && fh==1 pt1=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*7/7+i*sin(hh1/2)*1/7) elseif cnt==40 && fh==0 pt1=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*4/7) elseif cnt==41 && fh==1 pt1=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*2/7) pt2=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*4/7) elseif cnt==42 && fh==0 pt1=a*(cos(hh1/2)*0/7-i*sin(hh1/2)*10/7) pt2=a*(cos(hh1/2)*6/7-i*sin(hh1/2)*4/7) elseif cnt==43 && fh==1 pt1=a*(cos(hh1/2)*0/7+i*sin(hh1/2)*10/7) pt2=a*(cos(hh1/2)*6/7+i*sin(hh1/2)*4/7) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*2/7-(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*3/7 && fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*3/7 && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)a*sin(hh1/2)*2/7-(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) &&fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)>a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*4/7 &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*4/7 &&fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) && \ imag(z)a*cos(hh1/2)*5/7 &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*5/7 &&fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)>a*cos(hh1/2)*5/7 &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)a*cos(hh1/2)*5/7 &&fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && \ imag(z)>a*sin(hh1/2)*4/7-(real(z)-.5*4/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) &&fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)>-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*6/7 &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)a*sin(hh1/2)*2/7-(real(z)-.5*2/7)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*6/7 &&fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*5/7+(real(z)-.5*5/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*5/7 && real(z)a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*5/7 && real(z)a*sin(hh1/2)*4/7-(real(z)-.5*4/7)*tan(hh1/2) && \ real(z)1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*2/7-(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*3/7 && fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) \ && real(z)-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) &&\ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) &&\ imag(z)-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*3/7 && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)a*sin(hh1/2)*2/7-(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) &&fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)>a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*4/7 &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*4/7 &&fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) && \ imag(z)a*cos(hh1/2)*5/7 &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*5/7 &&fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && real(z)>a*cos(hh1/2)*5/7 &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)a*cos(hh1/2)*5/7 &&fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && \ imag(z)>a*sin(hh1/2)*4/7-(real(z)-.5*4/7)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) &&fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*2/7+(real(z)-.5*2/7)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*6/7 &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)>a*sin(hh1/2)*2/7-(real(z)-.5*2/7)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*6/7 &&fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/7+(real(z)-.5*3/7)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*5/7 && real(z)a*sin(hh1/2)*3/7-(real(z)-.5*3/7)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*5/7 && real(z)a*sin(hh1/2)*4/7-(real(z)-.5*4/7)*tan(hh1/2) && \ real(z)1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) || \ imag(z)>a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) ) && \ real(z)a*sin(hh1/2)*4/7-(real(z)-.5*4/7)*tan(hh1/2) \ && real(z)>a*cos(hh1/2)*6/7 && fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) \ && real(z)>a*cos(hh1/2)*6/7 && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*4/7-(real(z)-.5*4/7)*tan(hh1/2) &&\ imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) &&\ imag(z)>a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)a*cos(hh1/2)*6/7 && fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) \ && real(z)>a*cos(hh1/2)*6/7 && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) \ && real(z)a*sin(hh1/2)*4/7-(real(z)-.5*4/7)*tan(hh1/2) \ && real(z)-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) && fh==0 IF hh%6==0 c=@clrvlak6+.5 elseif hh%6==2 c=@clrvlak4+.5 elseif hh%6==4 c=@clrvlak5+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) && \ imag(z)>a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) && \ imag(z)-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) \ && real(z)a*cos(hh1/2)*3/7&& fh==0 IF hh%6==0 c=@clrvlak5+.5 elseif hh%6==2 c=@clrvlak6+.5 elseif hh%6==4 c=@clrvlak4+.5 endif endif if imag(z)a*cos(hh1/2)*3/7&& fh==1 IF hh%6==1 c=@clrvlak6+.5 elseif hh%6==3 c=@clrvlak4+.5 elseif hh%6==5 c=@clrvlak5+.5 endif endif if imag(z)>a*sin(hh1/2)*1/7-(real(z)-.5*1/7)*tan(hh1/2) \ && imag(z)a*cos(hh1/2)*6/7 && fh==0 IF hh%6==0 c=@clrvlak4+.5 elseif hh%6==2 c=@clrvlak5+.5 elseif hh%6==4 c=@clrvlak6+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/7+(real(z)-.5*1/7)*tan(hh1/2) \ && imag(z)>-a*sin(hh1/2)*4/7+(real(z)-.5*4/7)*tan(hh1/2) && real(z)>a*cos(hh1/2)*6/7 && fh==1 IF hh%6==1 c=@clrvlak4+.5 elseif hh%6==3 c=@clrvlak5+.5 elseif hh%6==5 c=@clrvlak6+.5 endif endif endif ; voor var=1 endif ; voor @pat=18 ;----------------------------------------- if @pat==19 cnt=1 while cnt<34 if cnt==1 && fh==0 pt1=a*(cos(hh1/2)*1/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*3/5) elseif cnt==2 && fh==1 pt1=a*(cos(hh1/2)*1/5+i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*3/5+i*sin(hh1/2)*3/5) elseif cnt==3 && fh==0 pt1=a*(cos(hh1/2)*0/5-i*sin(hh1/2)*0/5) pt2=a*(cos(hh1/2)*2/5+i*sin(hh1/2)*2/5) elseif cnt==4 && fh==1 pt1=a*(cos(hh1/2)*0/5+i*sin(hh1/2)*0/5) pt2=a*(cos(hh1/2)*2/5-i*sin(hh1/2)*2/5) elseif cnt==5 && fh==0 pt1=a*(cos(hh1/2)*3/5+i*sin(hh1/2)*3/5) pt2=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*4/5) elseif cnt==6 && fh==1 pt1=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*3/5) pt2=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*4/5) elseif cnt==7 && fh==0 pt1=a*(cos(hh1/2)*0/5-i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*2/5-i*sin(hh1/2)*0/5) elseif cnt==8 && fh==1 pt1=a*(cos(hh1/2)*0/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*2/5+i*sin(hh1/2)*0/5) elseif cnt==9 && fh==0 pt1=a*(cos(hh1/2)*2/5+i*sin(hh1/2)*7/5) pt2=a*(cos(hh1/2)*2/5+i*sin(hh1/2)*0/5) elseif cnt==10 && fh==1 pt1=a*(cos(hh1/2)*2/5-i*sin(hh1/2)*7/5) pt2=a*(cos(hh1/2)*2/5-i*sin(hh1/2)*0/5) elseif cnt==10 && fh==0 pt1=a*(cos(hh1/2)*2/5-i*sin(hh1/2)*0/5) pt2=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) elseif cnt==11 && fh==1 pt1=a*(cos(hh1/2)*2/5+i*sin(hh1/2)*0/5) pt2=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) elseif cnt==13 && fh==0 pt1=a*(cos(hh1/2)*0/5-i*sin(hh1/2)*6/5) pt2=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) elseif cnt==14 && fh==1 pt1=a*(cos(hh1/2)*0/5+i*sin(hh1/2)*6/5) pt2=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) elseif cnt==15 && fh==0 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*0/5) elseif cnt==16 && fh==1 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*0/5) elseif cnt==17 && fh==0 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*0/5) pt2=a*(cos(hh1/2)*3/5+i*sin(hh1/2)*1/5) elseif cnt==18 && fh==1 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*0/5) pt2=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*1/5) elseif cnt==18 && fh==0 pt1=a*(cos(hh1/2)*3/5+i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*3/5+i*sin(hh1/2)*8/5) elseif cnt==19 && fh==1 pt1=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*1/5) pt2=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*8/5) elseif cnt==20 && fh==0 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*0/5) pt2=a*(cos(hh1/2)*6/5+i*sin(hh1/2)*2/5) elseif cnt==21 && fh==1 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*0/5) pt2=a*(cos(hh1/2)*6/5-i*sin(hh1/2)*2/5) elseif cnt==22 && fh==0 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*6/5+i*sin(hh1/2)*0/5) elseif cnt==23 && fh==1 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*6/5+i*sin(hh1/2)*0/5) elseif cnt==24 && fh==0 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*7/5) elseif cnt==25 && fh==1 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*7/5) elseif cnt==26 && fh==0 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*3/5+i*sin(hh1/2)*1/5) elseif cnt==27 && fh==1 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*2/5) pt2=a*(cos(hh1/2)*3/5-i*sin(hh1/2)*1/5) elseif cnt==28 && fh==0 pt1=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*3/5) pt2=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*6/5) elseif cnt==29 && fh==1 pt1=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*3/5) pt2=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*6/5) elseif cnt==30 && fh==0 pt1=a*(cos(hh1/2)*5/5-i*sin(hh1/2)*3/5) pt2=a*(cos(hh1/2)*0/5-i*sin(hh1/2)*8/5) elseif cnt==31 && fh==1 pt1=a*(cos(hh1/2)*5/5+i*sin(hh1/2)*3/5) pt2=a*(cos(hh1/2)*0/5+i*sin(hh1/2)*8/5) elseif cnt==32 && fh==0 pt1=a*(cos(hh1/2)*4/5-i*sin(hh1/2)*4/5) pt2=a*(cos(hh1/2)*6/5-i*sin(hh1/2)*6/5) elseif cnt==33 && fh==1 pt1=a*(cos(hh1/2)*4/5+i*sin(hh1/2)*4/5) pt2=a*(cos(hh1/2)*6/5+i*sin(hh1/2)*6/5) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) && \ (real(z)a*cos(hh1/2)*3/5))&& fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)a*cos(hh1/2)*3/5)) && fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*3/5+(real(z)-.5*3/5)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*1/5-(real(z)-.5*1/5)*tan(hh1/2) && \ imag(z)-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)>a*sin(hh1/2)*1/5-(real(z)-.5*1/5)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*2/5 &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*2/5 &&fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*1/5-(real(z)-.5*1/5)*tan(hh1/2) && \ imag(z)a*cos(hh1/2)*2/5 &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*2/5+(real(z)-.5*2/5)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*2/5 &&fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>a*sin(hh1/2)*3/5-(real(z)-.5*3/5)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*4/5 &&fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/5+(real(z)-.5*3/5)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*4/5 &&fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/5+(real(z)-.5*1/5)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*2/5+(real(z)-.5*2/5)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*2/5-(real(z)-.5*2/5)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>a*sin(hh1/2)*1/5-(real(z)-.5*1/5)*tan(hh1/2) && \ imag(z)-a*sin(hh1/2)*3/5+(real(z)-.5*3/5)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*2/5+(real(z)-.5*2/5)*tan(hh1/2) &&fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)<-a*sin(hh1/2)*2/5+(real(z)-.5*2/5)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*3/5+(real(z)-.5*3/5)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*4/5 &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)>a*sin(hh1/2)*2/5-(real(z)-.5*2/5)*tan(hh1/2) && \ imag(z)a*cos(hh1/2)*4/5 &&fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)<-a*sin(hh1/2)*3/5+(real(z)-.5*3/5)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*4/5+(real(z)-.5*4/5)*tan(hh1/2) &&fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)>a*sin(hh1/2)*3/5-(real(z)-.5*3/5)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*4/5-(real(z)-.5*4/5)*tan(hh1/2)&&fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif endif ; voor var=1 endif ; voor @pat=19 ;----------------------------------------- if @pat==20 cnt=1 while cnt<69 if cnt==1 && fh==0 pt1=a*(cos(hh1/2)*1/9-i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*3/9-i*sin(hh1/2)*3/9) elseif cnt==2 && fh==1 pt1=a*(cos(hh1/2)*1/9+i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*3/9+i*sin(hh1/2)*3/9) elseif cnt==3 && fh==0 pt1=a*(cos(hh1/2)*4/9-i*sin(hh1/2)*4/9) pt2=a*(cos(hh1/2)*6/9-i*sin(hh1/2)*6/9) elseif cnt==4 && fh==1 pt1=a*(cos(hh1/2)*4/9+i*sin(hh1/2)*4/9) pt2=a*(cos(hh1/2)*6/9+i*sin(hh1/2)*6/9) elseif cnt==5 && fh==0 pt1=a*(cos(hh1/2)*7/9-i*sin(hh1/2)*7/9) pt2=a*(cos(hh1/2)*10/9-i*sin(hh1/2)*10/9) elseif cnt==6 && fh==1 pt1=a*(cos(hh1/2)*7/9+i*sin(hh1/2)*7/9) pt2=a*(cos(hh1/2)*10/9+i*sin(hh1/2)*10/9) elseif cnt==7 && fh==0 pt1=a*(cos(hh1/2)*0/9+i*sin(hh1/2)*0/9) pt2=a*(cos(hh1/2)*2/9+i*sin(hh1/2)*2/9) elseif cnt==8 && fh==1 pt1=a*(cos(hh1/2)*0/9-i*sin(hh1/2)*0/9) pt2=a*(cos(hh1/2)*2/9-i*sin(hh1/2)*2/9) elseif cnt==9 && fh==0 pt1=a*(cos(hh1/2)*3/9+i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*5/9+i*sin(hh1/2)*5/9) elseif cnt==10 && fh==1 pt1=a*(cos(hh1/2)*3/9-i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*5/9-i*sin(hh1/2)*5/9) elseif cnt==11 && fh==0 pt1=a*(cos(hh1/2)*6/9+i*sin(hh1/2)*6/9) pt2=a*(cos(hh1/2)*8/9+i*sin(hh1/2)*8/9) elseif cnt==12 && fh==1 pt1=a*(cos(hh1/2)*6/9-i*sin(hh1/2)*6/9) pt2=a*(cos(hh1/2)*8/9-i*sin(hh1/2)*8/9) elseif cnt==13 && fh==0 pt1=a*(cos(hh1/2)*0/9-i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*3/9+i*sin(hh1/2)*1/9) elseif cnt==14 && fh==1 pt1=a*(cos(hh1/2)*0/9+i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*3/9-i*sin(hh1/2)*1/9) elseif cnt==15 && fh==0 pt1=a*(cos(hh1/2)*0/9-i*sin(hh1/2)*6/9) pt2=a*(cos(hh1/2)*5/9-i*sin(hh1/2)*1/9) elseif cnt==16 && fh==1 pt1=a*(cos(hh1/2)*0/9+i*sin(hh1/2)*6/9) pt2=a*(cos(hh1/2)*5/9+i*sin(hh1/2)*1/9) elseif cnt==17 && fh==0 pt1=a*(cos(hh1/2)*0/9-i*sin(hh1/2)*8/9) pt2=a*(cos(hh1/2)*6/9-i*sin(hh1/2)*2/9) elseif cnt==18 && fh==1 pt1=a*(cos(hh1/2)*0/9+i*sin(hh1/2)*8/9) pt2=a*(cos(hh1/2)*6/9+i*sin(hh1/2)*2/9) elseif cnt==19 && fh==0 pt1=a*(cos(hh1/2)*0/9-i*sin(hh1/2)*12/9) pt2=a*(cos(hh1/2)*7/9-i*sin(hh1/2)*5/9) elseif cnt==20 && fh==1 pt1=a*(cos(hh1/2)*0/9+i*sin(hh1/2)*12/9) pt2=a*(cos(hh1/2)*7/9+i*sin(hh1/2)*5/9) elseif cnt==21 && fh==0 pt1=a*(cos(hh1/2)*0/9-i*sin(hh1/2)*14/9) pt2=a*(cos(hh1/2)*8/9-i*sin(hh1/2)*6/9) elseif cnt==22 && fh==1 pt1=a*(cos(hh1/2)*0/9+i*sin(hh1/2)*14/9) pt2=a*(cos(hh1/2)*8/9+i*sin(hh1/2)*6/9) elseif cnt==23 && fh==0 pt1=a*(cos(hh1/2)*4/9+i*sin(hh1/2)*0/9) pt2=a*(cos(hh1/2)*5/9+i*sin(hh1/2)*1/9) elseif cnt==24 && fh==1 pt1=a*(cos(hh1/2)*4/9-i*sin(hh1/2)*0/9) pt2=a*(cos(hh1/2)*5/9-i*sin(hh1/2)*1/9) elseif cnt==25 && fh==0 pt1=a*(cos(hh1/2)*6/9+i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*8/9+i*sin(hh1/2)*4/9) elseif cnt==26 && fh==1 pt1=a*(cos(hh1/2)*6/9-i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*8/9-i*sin(hh1/2)*4/9) elseif cnt==27 && fh==0 pt1=a*(cos(hh1/2)*2/9+i*sin(hh1/2)*0/9) pt2=a*(cos(hh1/2)*2/9+i*sin(hh1/2)*9/9) elseif cnt==28 && fh==1 pt1=a*(cos(hh1/2)*2/9-i*sin(hh1/2)*0/9) pt2=a*(cos(hh1/2)*2/9-i*sin(hh1/2)*9/9) elseif cnt==29 && fh==0 pt1=a*(cos(hh1/2)*3/9+i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*3/9+i*sin(hh1/2)*9/9) elseif cnt==30 && fh==1 pt1=a*(cos(hh1/2)*3/9-i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*3/9-i*sin(hh1/2)*9/9) elseif cnt==31 && fh==0 pt1=a*(cos(hh1/2)*5/9+i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*5/9+i*sin(hh1/2)*9/9) elseif cnt==32 && fh==1 pt1=a*(cos(hh1/2)*5/9-i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*5/9-i*sin(hh1/2)*9/9) elseif cnt==33 && fh==0 pt1=a*(cos(hh1/2)*6/9+i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*6/9+i*sin(hh1/2)*9/9) elseif cnt==34 && fh==1 pt1=a*(cos(hh1/2)*6/9-i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*6/9-i*sin(hh1/2)*9/9) elseif cnt==35 && fh==0 pt1=a*(cos(hh1/2)*8/9+i*sin(hh1/2)*4/9) pt2=a*(cos(hh1/2)*8/9+i*sin(hh1/2)*9/9) elseif cnt==36 && fh==1 pt1=a*(cos(hh1/2)*8/9-i*sin(hh1/2)*4/9) pt2=a*(cos(hh1/2)*8/9-i*sin(hh1/2)*9/9) elseif cnt==37 && fh==0 pt1=a*(cos(hh1/2)*5/9+i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*6/9+i*sin(hh1/2)*2/9) elseif cnt==38 && fh==1 pt1=a*(cos(hh1/2)*5/9-i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*6/9-i*sin(hh1/2)*2/9) elseif cnt==39 && fh==0 pt1=a*(cos(hh1/2)*8/9+i*sin(hh1/2)*6/9) pt2=a*(cos(hh1/2)*10/9+i*sin(hh1/2)*4/9) elseif cnt==40 && fh==1 pt1=a*(cos(hh1/2)*8/9-i*sin(hh1/2)*6/9) pt2=a*(cos(hh1/2)*10/9-i*sin(hh1/2)*4/9) elseif cnt==41 && fh==0 pt1=a*(cos(hh1/2)*3/9+i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*5/9-i*sin(hh1/2)*1/9) elseif cnt==42 && fh==1 pt1=a*(cos(hh1/2)*3/9-i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*5/9+i*sin(hh1/2)*1/9) elseif cnt==43 && fh==0 pt1=a*(cos(hh1/2)*5/9-i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*5/9-i*sin(hh1/2)*1/9) elseif cnt==44 && fh==1 pt1=a*(cos(hh1/2)*5/9+i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*5/9+i*sin(hh1/2)*1/9) elseif cnt==45 && fh==0 pt1=a*(cos(hh1/2)*6/9-i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*7/9-i*sin(hh1/2)*3/9) elseif cnt==46 && fh==1 pt1=a*(cos(hh1/2)*6/9+i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*7/9+i*sin(hh1/2)*3/9) elseif cnt==47 && fh==0 pt1=a*(cos(hh1/2)*9/9+i*sin(hh1/2)*5/9) pt2=a*(cos(hh1/2)*9/9+i*sin(hh1/2)*10/9) elseif cnt==48 && fh==1 pt1=a*(cos(hh1/2)*9/9-i*sin(hh1/2)*5/9) pt2=a*(cos(hh1/2)*9/9-i*sin(hh1/2)*10/9) elseif cnt==49 && fh==0 pt1=a*(cos(hh1/2)*9/9+i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*9/9-i*sin(hh1/2)*1/9) elseif cnt==50 && fh==1 pt1=a*(cos(hh1/2)*9/9-i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*9/9+i*sin(hh1/2)*1/9) elseif cnt==51 && fh==0 pt1=a*(cos(hh1/2)*9/9+i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*9/9-i*sin(hh1/2)*1/9) elseif cnt==52 && fh==1 pt1=a*(cos(hh1/2)*9/9-i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*9/9+i*sin(hh1/2)*1/9) elseif cnt==53 && fh==0 pt1=a*(cos(hh1/2)*10/9-i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*7/9+i*sin(hh1/2)*1/9) elseif cnt==54 && fh==1 pt1=a*(cos(hh1/2)*10/9+i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*7/9-i*sin(hh1/2)*1/9) elseif cnt==55 && fh==0 pt1=a*(cos(hh1/2)*10/9+i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*8/9+i*sin(hh1/2)*4/9) elseif cnt==56 && fh==1 pt1=a*(cos(hh1/2)*10/9-i*sin(hh1/2)*2/9) pt2=a*(cos(hh1/2)*8/9-i*sin(hh1/2)*4/9) elseif cnt==57 && fh==0 pt1=a*(cos(hh1/2)*7/9+i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*7/9+i*sin(hh1/2)*3/9) elseif cnt==58 && fh==1 pt1=a*(cos(hh1/2)*7/9-i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*7/9-i*sin(hh1/2)*3/9) elseif cnt==59 && fh==0 pt1=a*(cos(hh1/2)*9/9-i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*9/9-i*sin(hh1/2)*7/9) elseif cnt==60 && fh==1 pt1=a*(cos(hh1/2)*9/9+i*sin(hh1/2)*3/9) pt2=a*(cos(hh1/2)*9/9+i*sin(hh1/2)*7/9) elseif cnt==61 && fh==0 pt1=a*(cos(hh1/2)*8/9-i*sin(hh1/2)*0/9) pt2=a*(cos(hh1/2)*7/9-i*sin(hh1/2)*1/9) elseif cnt==62 && fh==1 pt1=a*(cos(hh1/2)*8/9+i*sin(hh1/2)*0/9) pt2=a*(cos(hh1/2)*7/9+i*sin(hh1/2)*1/9) elseif cnt==63 && fh==0 pt1=a*(cos(hh1/2)*7/9-i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*7/9-i*sin(hh1/2)*5/9) elseif cnt==64 && fh==1 pt1=a*(cos(hh1/2)*7/9+i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*7/9+i*sin(hh1/2)*5/9) elseif cnt==65 && fh==0 pt1=a*(cos(hh1/2)*7/9-i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*10/9-i*sin(hh1/2)*4/9) elseif cnt==66 && fh==1 pt1=a*(cos(hh1/2)*7/9+i*sin(hh1/2)*1/9) pt2=a*(cos(hh1/2)*10/9+i*sin(hh1/2)*4/9) elseif cnt==67 && fh==0 pt1=a*(cos(hh1/2)*7/9-i*sin(hh1/2)*5/9) pt2=a*(cos(hh1/2)*10/9-i*sin(hh1/2)*8/9) elseif cnt==68 && fh==1 pt1=a*(cos(hh1/2)*7/9+i*sin(hh1/2)*5/9) pt2=a*(cos(hh1/2)*10/9+i*sin(hh1/2)*8/9) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist-a*sin(hh1/2)*1/9+(real(z)-.5*1/9)*tan(hh1/2) && \ (real(z)a*cos(hh1/2)*3/9)||\ (real(z)a*cos(hh1/2)*6/9))&& fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)a*cos(hh1/2)*3/9)||\ (real(z)a*cos(hh1/2)*6/9))&& fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*1/9+(real(z)-.5*1/9)*tan(hh1/2) && \ ((real(z)a*cos(hh1/2)*2/9)||\ (real(z)a*cos(hh1/2)*8/9)|| \ (real(z)a*cos(hh1/2)*5/9))&& fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)a*cos(hh1/2)*2/9)||\ (real(z)a*cos(hh1/2)*8/9)|| \ (real(z)a*cos(hh1/2)*5/9))&& fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>-a*sin(hh1/2)*2/9+(real(z)-.5*2/9)*tan(hh1/2) && \ real(z)a*cos(hh1/2)*3/9 &&\ imag(z)>a*sin(hh1/2)*2/9-(real(z)-.5*2/9)*tan(hh1/2) && fh==0 IF hh%6==0 c=@clrvlak2+.5 elseif hh%6==2 c=@clrvlak3+.5 elseif hh%6==4 c=@clrvlak1+.5 endif endif if imag(z)a*cos(hh1/2)*3/9 &&\ imag(z)<-a*sin(hh1/2)*2/9+(real(z)-.5*2/9)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)>a*sin(hh1/2)*4/9-(real(z)-.5*4/9)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*5/9 && real(z)a*cos(hh1/2)*5/9 && real(z)-a*sin(hh1/2)*2/9+(real(z)-.5*2/9)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*6/9 && real(z)a*cos(hh1/2)*6/9 && real(z)a*sin(hh1/2)*7/9-(real(z)-.5*7/9)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*8/9 && fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)<-a*sin(hh1/2)*7/9+(real(z)-.5*7/9)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*8/9 && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)>-a*sin(hh1/2)*3/9+(real(z)-.5*3/9)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*1/9+(real(z)-.5*1/9)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*1/9-(real(z)-.5*1/9)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*2/9+(real(z)-.5*2/9)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)>-a*sin(hh1/2)*4/9+(real(z)-.5*4/9)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*3/9+(real(z)-.5*3/9)*tan(hh1/2) && \ real(z)a*sin(hh1/2)*3/9-(real(z)-.5*3/9)*tan(hh1/2) && \ real(z)-a*sin(hh1/2)*6/9+(real(z)-.5*6/9)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*4/9+(real(z)-.5*4/9)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*4/9-(real(z)-.5*4/9)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*2/9+(real(z)-.5*2/9)*tan(hh1/2) && \ real(z)-a*sin(hh1/2)*7/9+(real(z)-.5*7/9)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*6/9+(real(z)-.5*6/9)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*6/9-(real(z)-.5*6/9)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*1/9+(real(z)-.5*1/9)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak3+.5 elseif hh%6==3 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)<-a*sin(hh1/2)*7/9+(real(z)-.5*7/9)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*7/9-(real(z)-.5*7/9)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*1/9+(real(z)-.5*1/9)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)a*sin(hh1/2)*1/9-(real(z)-.5*1/9)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*7/9 && fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)>-a*sin(hh1/2)*3/9+(real(z)-.5*3/9)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*1/9+(real(z)-.5*1/9)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*7/9 && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)a*sin(hh1/2)*3/9-(real(z)-.5*3/9)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*4/9+(real(z)-.5*4/9)*tan(hh1/2) && fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*4/9+(real(z)-.5*4/9)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*3/9+(real(z)-.5*3/9)*tan(hh1/2) && \ imag(z)>a*sin(hh1/2)*4/9-(real(z)-.5*4/9)*tan(hh1/2) && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif if imag(z)a*sin(hh1/2)*4/9-(real(z)-.5*4/9)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*2/9+(real(z)-.5*2/9)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*7/9 && fh==0 IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==2 c=@clrvlak2+.5 elseif hh%6==4 c=@clrvlak3+.5 endif endif if imag(z)>-a*sin(hh1/2)*6/9+(real(z)-.5*6/9)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*4/9+(real(z)-.5*4/9)*tan(hh1/2) && \ imag(z)>a*sin(hh1/2)*2/9-(real(z)-.5*2/9)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*7/9 && fh==1 IF hh%6==1 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 elseif hh%6==5 c=@clrvlak3+.5 endif endif if imag(z)a*sin(hh1/2)*6/9-(real(z)-.5*6/9)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*8/9 && fh==0 IF hh%6==0 c=@clrvlak3+.5 elseif hh%6==2 c=@clrvlak1+.5 elseif hh%6==4 c=@clrvlak2+.5 endif endif if imag(z)>-a*sin(hh1/2)*7/9+(real(z)-.5*7/9)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*6/9+(real(z)-.5*6/9)*tan(hh1/2) && \ real(z)>a*cos(hh1/2)*8/9 && fh==1 IF hh%6==1 c=@clrvlak2+.5 elseif hh%6==3 c=@clrvlak3+.5 elseif hh%6==5 c=@clrvlak1+.5 endif endif endif ; voor var=1 endif ; voor @pat=20 ;----------------------------------------- if @pat==21 cnt=1 while cnt<50 if cnt==1 && (hh%6==0 || hh%6==3 ) pt1=a*(cos(hh1/2)*1/8+i) pt2=a*(cos(hh1/2)*1/8-i) elseif cnt==2 && (hh%6==0) pt1=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*1/8) pt2=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*5/8) elseif cnt==3 && (hh%6==3 ) pt1=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*1/8) pt2=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*5/8) elseif cnt==4 && (hh%6==0|| hh%6==3) pt1=a*(cos(hh1/2)*2/8-i) pt2=a*(cos(hh1/2)*2/8+i) ; elseif cnt==5 && (hh%6==3 ) ; pt1=a*(cos(hh1/2)*2/8-i*sin(hh1/2)*0/8) ; pt2=a*(cos(hh1/2)*2/8-i) elseif cnt==6 && (hh%6==0 ||hh%6==3 ) pt1=a*(cos(hh1/2)*8/8+i) pt2=a*(cos(hh1/2)*8/8-i) elseif cnt==7 && (hh%6==1 ) pt1=a*(cos(hh1/2)*0/8+i*sin(hh1/2)*0/8) pt2=a*(cos(hh1/2)*9/8+i*sin(hh1/2)*9/8) elseif cnt==8 && (hh%6==2 ) pt1=a*(cos(hh1/2)*0/8+i*sin(hh1/2)*0/8) pt2=a*(cos(hh1/2)*9/8-i*sin(hh1/2)*9/8) elseif cnt==9 && (hh%6==1 ) pt1=a*(cos(hh1/2)*0/8-i*sin(hh1/2)*2/8) pt2=a*(cos(hh1/2)*4/8+i*sin(hh1/2)*2/8) elseif cnt==10 && (hh%6==2 ) pt1=a*(cos(hh1/2)*0/8+i*sin(hh1/2)*2/8) pt2=a*(cos(hh1/2)*4/8-i*sin(hh1/2)*2/8) ; elseif cnt==11 && (hh%6==0 ) ; pt1=a*(cos(hh1/2)*0/8-i*sin(hh1/2)*0/8) ; pt2=a*(cos(hh1/2)*1/8-i*sin(hh1/2)*1/8) ; elseif cnt==12 && (hh%6==3 ) ; pt1=a*(cos(hh1/2)*0/8+i*sin(hh1/2)*0/8) ; pt2=a*(cos(hh1/2)*1/8+i*sin(hh1/2)*1/8) elseif cnt==13 && (hh%6==0 ) pt1=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*5/8) pt2=a*(cos(hh1/2)*9/8-i*sin(hh1/2)*7/8) elseif cnt==14 && (hh%6==0 ) pt1=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*5/8) pt2=a*(cos(hh1/2)*5/8-i*sin(hh1/2)*7/8) ; elseif cnt==15 && (hh%6==0 ) ; pt1=a*(cos(hh1/2)*1/8-i*sin(hh1/2)*1/8) ; pt2=a*(cos(hh1/2)*2/8-i*sin(hh1/2)*0/8) ; elseif cnt==16 && (hh%6==3 ) ; pt1=a*(cos(hh1/2)*1/8+i*sin(hh1/2)*1/8) ; pt2=a*(cos(hh1/2)*2/8+i*sin(hh1/2)*0/8) elseif cnt==17 && (hh%6==1 ) pt1=a*(cos(hh1/2)*2/8-i*sin(hh1/2)*2/8) pt2=a*(cos(hh1/2)*5/8+i*sin(hh1/2)*1/8) elseif cnt==18 && (hh%6==2 ) pt1=a*(cos(hh1/2)*2/8+i*sin(hh1/2)*2/8) pt2=a*(cos(hh1/2)*5/8-i*sin(hh1/2)*1/8) elseif cnt==19 && (hh%6==0 ) pt1=a*(cos(hh1/2)*8/8-i*sin(hh1/2)*6/8) pt2=a*(cos(hh1/2)*6/8-i*sin(hh1/2)*8/8) elseif cnt==20 && (hh%6==5 ) pt1=a*(cos(hh1/2)*7/8+i) pt2=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*3/8) elseif cnt==21 && (hh%6==5 ) pt1=a*(cos(hh1/2)*6/8+i) pt2=a*(cos(hh1/2)*6/8-i*sin(hh1/2)*2/8) elseif cnt==22 && (hh%6==3 ) pt1=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*5/8) pt2=a*(cos(hh1/2)*9/8+i*sin(hh1/2)*7/8) elseif cnt==23 && (hh%6==3 ) pt1=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*5/8) pt2=a*(cos(hh1/2)*5/8+i*sin(hh1/2)*7/8) ; elseif cnt==24 && (hh%6==3 ) ; pt1=a*(cos(hh1/2)*1/8+i*sin(hh1/2)*1/8) ; pt2=a*(cos(hh1/2)*2/8+i*sin(hh1/2)*0/8) elseif cnt==25 && (hh%6==3 ) pt1=a*(cos(hh1/2)*8/8+i*sin(hh1/2)*6/8) pt2=a*(cos(hh1/2)*6/8+i*sin(hh1/2)*8/8) elseif cnt==26 && (hh%6==5 ) pt1=a*(cos(hh1/2)*0/8-i*sin(hh1/2)*0/8) pt2=a*(cos(hh1/2)*6/8-i*sin(hh1/2)*6/8) elseif cnt==27 && (hh%6==4 ) pt1=a*(cos(hh1/2)*0/8+i*sin(hh1/2)*0/8) pt2=a*(cos(hh1/2)*6/8+i*sin(hh1/2)*6/8) elseif cnt==28 && (hh%6==4 ) pt1=a*(cos(hh1/2)*7/8-i) pt2=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*3/8) elseif cnt==29 && (hh%6==4 ) pt1=a*(cos(hh1/2)*6/8-i) pt2=a*(cos(hh1/2)*6/8+i*sin(hh1/2)*2/8) elseif cnt==30 && (hh%6==5 ) pt1=a*(cos(hh1/2)*2/8+i*sin(hh1/2)*2/8) pt2=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*3/8) elseif cnt==31 && (hh%6==4 ) pt1=a*(cos(hh1/2)*2/8-i*sin(hh1/2)*2/8) pt2=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*3/8) elseif cnt==32 && (hh%6==5 ) pt1=a*(cos(hh1/2)*1/8+i*sin(hh1/2)*1/8) pt2=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*5/8) elseif cnt==33 && (hh%6==4 ) pt1=a*(cos(hh1/2)*1/8-i*sin(hh1/2)*1/8) pt2=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*5/8) elseif cnt==34 && (hh%6==5 ) pt1=a*(cos(hh1/2)*6/8-i*sin(hh1/2)*6/8) pt2=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*5/8) elseif cnt==35 && (hh%6==4 ) pt1=a*(cos(hh1/2)*6/8+i*sin(hh1/2)*6/8) pt2=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*5/8) elseif cnt==36 && (hh%6==5 ) pt1=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*5/8) pt2=a*(cos(hh1/2)*7/8-i) elseif cnt==37 && (hh%6==4 ) pt1=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*5/8) pt2=a*(cos(hh1/2)*7/8+i) elseif cnt==38 && (hh%6==5 ) pt1=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*7/8) pt2=a*(cos(hh1/2)*9/8-i*sin(hh1/2)*9/8) elseif cnt==39 && (hh%6==4 ) pt1=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*7/8) pt2=a*(cos(hh1/2)*9/8+i*sin(hh1/2)*9/8) elseif cnt==40 && (hh%6==1 || hh%6==2|| hh%6==4) pt1=a*(cos(hh1/2)*7/8-i*sin(hh1/2)*9/8) pt2=a*(cos(hh1/2)*9/8-i*sin(hh1/2)*7/8) elseif cnt==41 && (hh%6==2 || hh%6==1 || hh%6==5) pt1=a*(cos(hh1/2)*7/8+i*sin(hh1/2)*9/8) pt2=a*(cos(hh1/2)*9/8+i*sin(hh1/2)*7/8) elseif cnt==42 && (hh%6==0|| hh%6==3) pt1=a*(cos(hh1/2)*0/8+i*sin(hh1/2)*9/8) pt2=a*(cos(hh1/2)*0/8-i*sin(hh1/2)*9/8) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if disth4 ) dd=dist test=(d/2-dd)/d/2 endif cnt=cnt+1 endwhile c=test +@clrlijn cc=c-@clrlijn if var==1 c=0 if real(z)>a*cos(hh1/2)*7/8 && ( hh%6==0 || hh%6==3 ) IF hh%6==0 c=@clrvlak1+.5 elseif hh%6==3 c=@clrvlak2+.5 endif endif if imag(z)<-a*sin(hh1/2)*7/8+(real(z)-.5*7/8)*tan(hh1/2) && hh%6==0 c=@clrvlak2+.5 endif if imag(z)>a*sin(hh1/2)*7/8-(real(z)-.5*7/8)*tan(hh1/2) && hh%6==3 c=@clrvlak1+.5 endif if real(z)a*cos(hh1/2)*1/8 &&hh%6==0 c=@clrvlak2+.5 endif if real(z)a*cos(hh1/2)*1/8 && hh%6==3 c=@clrvlak1+.5 endif if real(z)r && \ (h2

h4 ) && ( hh%6==1 ) c=@clrvlak2+.5 endif pt1=a*(cos(hh1/2)*6/8+i*sin(hh1/2)*2/8) h2=atan2(z-pt1) if h2<0 h2=h2+2*#pi endif h3=2*#pi;-#pi*.43 h4=#pi*1.26 r=a*(cos(hh1/2)*2/8) if cabs(z-pt1)>r && \ (h2

h4 ) && ( hh%6==2 ) c=@clrvlak1+.5 endif if imag(z)>-a*sin(hh1/2)*1/8+(real(z)-.5*1/8)*tan(hh1/2) && hh%6==1 c=@clrvlak1+.5 endif if imag(z)r && (h2

h4 ) && ( hh%6==0 ) c=@clrvlak1+.5 endif pt1=a*(cos(hh1/2)*1/8-i*sin(hh1/2)*1/8) h2=atan2(z-pt1) if h2<0 h2=h2+2*#pi endif h3=2*#pi h4=11*2*#pi/12 r=a*(cos(hh1/2)*6/8) if cabs(z-pt1)>r && (h2

h4 ) && ( hh%6==3 ) c=@clrvlak2+.5 endif pt1=a*(cos(hh1/2)*1/8-i*sin(hh1/2)*1/8) h2=atan2(z-pt1) if h2<0 h2=h2+2*#pi endif h3=2*#pi h4=11*2*#pi/12 r=a*(cos(hh1/2)*6/8) if cabs(z-pt1)>r && \ (h2

h4 ) && ( hh%6==1 ) c=@clrvlak1+.5 endif pt1=a*(cos(hh1/2)*1/8+i*sin(hh1/2)*1/8) h2=atan2(z-pt1) if h2<0 h2=h2+2*#pi endif h3=#pi/3 h4=0 r=a*(cos(hh1/2)*6/8) if cabs(z-pt1)>r && \ (h2

h4 ) && ( hh%6==2 ) c=@clrvlak2+.5 endif pt1=a*(cos(hh1/2)*5/8-i*sin(hh1/2)*1/8) h2=atan2(z-pt1) if h2<0 h2=h2+2*#pi endif h3=#pi*2/3 h4=0 r=a*(cos(hh1/2)*2/8) if cabs(z-pt1)>r && \ (h2

h4 ) && ( hh%6==1 ) c=@clrvlak1+.5 endif pt1=a*(cos(hh1/2)*5/8+i*sin(hh1/2)*1/8) h2=atan2(z-pt1) if h2<0 h2=h2+2*#pi endif h3=#pi*2 h4=#pi*4/3 r=a*(cos(hh1/2)*2/8) if cabs(z-pt1)>r && \ (h2

h4 ) && ( hh%6==2 ) c=@clrvlak2+.5 endif if real(z)>a*cos(hh1/2)*7/8 IF hh%6==4 c=@clrvlak1+.5 elseif hh%6==5 c=@clrvlak2+.5 endif endif if imag(z)<-a*sin(hh1/2)*1/8+(real(z)-.5*1/8)*tan(hh1/2) && \ imag(z)>-a*sin(hh1/2)*2/8+(real(z)-.5*2/8)*tan(hh1/2) && \ imag(z)a*sin(hh1/2)*1/8-(real(z)-.5*1/8)*tan(hh1/2) && \ imag(z)-a*sin(hh1/2)*3/8+(real(z)-.5*3/8)*tan(hh1/2) && hh%6==2 c=@clrvlak1+.5 endif if imag(z)a*sin(hh1/2)*1/8-(real(z)-.5*1/8)*tan(hh1/2) && hh%6==5 c=@clrvlak2+.5 endif if imag(z)>-a*sin(hh1/2)*2/8+(real(z)-.5*2/8)*tan(hh1/2) && \ imag(z)<-a*sin(hh1/2)*1/8+(real(z)-.5*1/8)*tan(hh1/2) && hh%6==4 c=@clrvlak1+.5 endif if imag(z)-a*sin(hh1/2)*6/8+(real(z)-.5*6/8)*tan(hh1/2) && hh%6==5 c=@clrvlak1+.5 endif if imag(z)>-a*sin(hh1/2)*1/8+(real(z)-.5*1/8)*tan(hh1/2) && \ imag(z)-a*sin(hh1/2)*7/8+(real(z)-.5*7/8)*tan(hh1/2) && hh%6==0 c=@clrvlak3+.5 endif if imag(z)>-a*sin(hh1/2)*1/8+(real(z)-.5*1/8)*tan(hh1/2) && \ imag(z)>a*sin(hh1/2)*6/8-(real(z)-.5*6/8)*tan(hh1/2) && \ imag(z)a*cos(hh1/2)*6/8 && \ (imag(z)>a*sin(hh1/2)*2/8-(real(z)-.5*2/8)*tan(hh1/2) || \ imag(z)<-a*sin(hh1/2)*6/8+(real(z)-.5*6/8)*tan(hh1/2) ) && hh%6==5 c=@clrvlak3+.5 endif if real(z)a*cos(hh1/2)*6/8 && \ (imag(z)<-a*sin(hh1/2)*2/8+(real(z)-.5*2/8)*tan(hh1/2) || \ imag(z)>a*sin(hh1/2)*6/8-(real(z)-.5*6/8)*tan(hh1/2) ) && hh%6==4 c=@clrvlak3+.5 endif endif ; voor var=1 endif ; voor @pat=21 ;----------------------------------------- if @pat==22 pt1=0 r=a*(cos(hh1/2)) dist = abs(cabs(z-pt1)-r) if dist1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) dist = abs(imag(z)) if dist1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist4,complex P[4]=(@p5)/2,endif if @pts>5,complex P[5]=(@p6)/2,endif if @pts>6,complex P[6]=(@p7)/2,endif if @pts>7,complex P[7]=(@p8)/2,endif if @pts>8,complex P[8]=(@p9)/2,endif if @pts>9,complex P[9]=(@p10)/2,endif if @pts>10,complex P[10]=(@p11)/2,endif if @pts>11,complex P[11]=(@p12)/2,endif if @pts>12,complex P[12]=(@p13)/2,endif if @pts>13,complex P[13]=(@p14)/2,endif if @pts>14,complex P[14]=(@p15)/2,endif if @pts>15,complex P[15]=(@p16)/2,endif if @pts>16,complex P[16]=(@p17)/2,endif if @pts>17,complex P[17]=(@p18)/2,endif if @pts>18,complex P[18]=(@p19)/2,endif if @pts>19,complex P[19]=(@p20)/2,endif if @pts>20,complex P[20]=(@p21)/2,endif if @pts>21,complex P[21]=(@p22)/2,endif if @pts>22,complex P[22]=(@p23)/2,endif if @pts>23,complex P[23]=(@p24)/2,endif if @pts>24,complex P[24]=(@p25)/2,endif if @pts>25,complex P[25]=(@p26)/2,endif if @pts>26,complex P[26]=(@p27)/2,endif if @pts>27,complex P[27]=(@p28)/2,endif if @pts>28,complex P[28]=(@p29)/2,endif if @pts>29,complex P[29]=(@p30)/2,endif if @pts>30,complex P[30]=(@p31)/2,endif if @pts>31,complex P[31]=(@p32)/2,endif if @pts>32,complex P[32]=(@p33)/2,endif if @pts>33,complex P[33]=(@p34)/2,endif if @pts>34,complex P[34]=(@p35)/2,endif if @pts>35,complex P[35]=(@p36)/2,endif if @pts>36,complex P[36]=(@p37)/2,endif if @pts>37,complex P[37]=(@p38)/2,endif if @pts>38,complex P[38]=(@p39)/2,endif if @pts>39,complex P[39]=(@p40)/2,endif if @pts>40,complex P[40]=(@p41)/2,endif if @pts>41,complex P[41]=(@p42)/2,endif if @pts>42,complex P[42]=(@p43)/2,endif if @pts>43,complex P[43]=(@p44)/2,endif if @pts>44,complex P[44]=(@p45)/2,endif if @pts>45,complex P[45]=(@p46)/2,endif if @pts>46,complex P[46]=(@p47)/2,endif if @pts>47,complex P[47]=(@p48)/2,endif if @pts>48,complex P[48]=(@p49)/2,endif if @pts>49,complex P[49]=(@p50)/2,endif if @pts>50,complex P[50]=(@p51)/2,endif if @pts>51,complex P[51]=(@p52)/2,endif if @pts>52,complex P[52]=(@p53)/2,endif if @pts>53,complex P[53]=(@p54)/2,endif if @pts>54,complex P[54]=(@p55)/2,endif if @pts>55,complex P[55]=(@p56)/2,endif if @pts>56,complex P[56]=(@p57)/2,endif if @pts>57,complex P[57]=(@p58)/2,endif if @pts>58,complex P[58]=(@p59)/2,endif if @pts>59,complex P[59]=(@p60)/2,endif if @pts>60,complex P[60]=(@p61)/2,endif if @pts>61,complex P[61]=(@p62)/2,endif if @pts>62,complex P[62]=(@p63)/2,endif if @pts>63,complex P[63]=(@p64)/2,endif if @pts>64,complex P[64]=(@p65)/2,endif if @pts>65,complex P[65]=(@p66)/2,endif if @pts>66,complex P[66]=(@p67)/2,endif if @pts>67,complex P[67]=(@p68)/2,endif if @pts>68,complex P[68]=(@p69)/2,endif if @pts>69,complex P[69]=(@p70)/2,endif if @pts>70,complex P[70]=(@p71)/2,endif if @pts>71,complex P[71]=(@p72)/2,endif if @pts>72,complex P[72]=(@p73)/2,endif if @pts>73,complex P[73]=(@p74)/2,endif if @pts>74,complex P[74]=(@p75)/2,endif if @pts>75,complex P[75]=(@p76)/2,endif if @pts>76,complex P[76]=(@p77)/2,endif if @pts>77,complex P[77]=(@p78)/2,endif if @pts>78,complex P[78]=(@p79)/2,endif if @pts>79,complex P[79]=(@p80)/2,endif if @pts>80,complex P[80]=(@p81)/2,endif if @pts>81,complex P[81]=(@p82)/2,endif if @pts>82,complex P[82]=(@p83)/2,endif if @pts>83,complex P[83]=(@p84)/2,endif if @pts>84,complex P[84]=(@p85)/2,endif if @pts>85,complex P[85]=(@p86)/2,endif if @pts>86,complex P[86]=(@p87)/2,endif if @pts>87,complex P[87]=(@p88)/2,endif if @pts>88,complex P[88]=(@p89)/2,endif if @pts>89,complex P[89]=(@p90)/2,endif if @pts>90,complex P[90]=(@p91)/2,endif if @pts>91,complex P[91]=(@p92)/2,endif if @pts>92,complex P[92]=(@p93)/2,endif if @pts>93,complex P[93]=(@p94)/2,endif if @pts>94,complex P[94]=(@p95)/2,endif if @pts>95,complex P[95]=(@p96)/2,endif if @pts>96,complex P[96]=(@p97)/2,endif if @pts>97,complex P[97]=(@p98)/2,endif if @pts>98,complex P[98]=(@p99)/2,endif if @pts>99,complex P[99]=(@p100)/2,endif complex C1=@C1/2 int k=0,while k<@pts if P[k]==(0,0), P[k]=C1,endif k=k+1,endwhile final: ; Use #pixel as the complex coordinate inside the image, but scale such that ; the default corner coordinates (-2,1.5)..(2,-1.5) correspond to the entire ; image width. complex c = 0.5 * #pixel ; Make sure the ratio of the image is preserved. float ratio if !i.getEmpty() ratio = i.getWidth() / i.getHeight() else ratio = 1 endif color kol= i.getColor(real(c) + flip(imag(c) * ratio)) color kol2=kol float tr=1 int j=0, while j<@pts float alfa=atan2(P[j]-c), if alfa<0,alfa=alfa+2*#pi,endif int a =j+1, if a==@pts,a=0,endif float beta=atan2(P[a]-c), if beta<0,beta=beta+2*#pi,endif float gamma=atan2(C1-c), if gamma<0,gamma=gamma+2*#pi,endif float S1=beta-alfa, if S1<0, S1=-S1, endif,if S1>#pi, S1=2*#pi-S1,endif float S2=gamma-beta, if S2<0, S2=-S2, endif,if S2>#pi, S2=2*#pi-S2,endif float S3=alfa-gamma, if S3<0, S3=-S3, endif,if S3>#pi, S3=2*#pi-S3,endif if abs(S1+S2+S3-2*#pi)<.01, bool in=true,else, bool in=false,endif float ed=imag((c-P[j])/(P[a]-P[j])) float cd=imag((C1-P[j])/(P[a]-P[j])) if @trans if @inv==false if in==true if @se==true if @sevar==0 if ed/cd<@sefac, tr=(@sefac*cd-ed)/(cd*@sefac) else ,tr=0 endif elseif @sevar==1 if ed/cd<@sefac/2, tr=(@sefac*cd/2-ed)/(cd*@sefac) else ,tr=0 endif elseif @sevar==2 tr=0 endif ; voor @sevar else ; voor @se tr=0 endif; voor @se j=@pts endif if (in==false && ed<0 && imag((c-P[a])/(C1-P[a]))>0 && imag((c-C1)/(P[j]-C1))>0) tr=1 if @se==true if @sevar==1 if abs(ed/cd)<@sefac/2 tr=(@sefac*cd/2-ed)/(cd*@sefac) endif endif if @sevar==2 if abs(ed/cd)<@sefac tr=(abs(ed))/(cd*@sefac) endif endif endif;voor@se ;j=@pts endif kol2=rgba(red(kol), green(kol), blue(kol), tr) endif; voor @inv if @inv==true if in==true if @se==true if @sevar==0 if ed/cd<@sefac, tr=(ed)/(cd*@sefac) else ,tr=1 endif elseif @sevar==1 if ed/cd<@sefac/2, tr=.5+(ed)/(cd*@sefac) else ,tr=1 endif elseif @sevar==2 tr=1 endif ; voor @sevar else ; voor @se tr=1 endif; voor @se j=@pts endif if (in==false && ed<0 && imag((c-P[a])/(C1-P[a]))>0 && imag((c-C1)/(P[j]-C1))>0) tr=0 if @se==true if @sevar==1 if abs(ed/cd)<@sefac/2 tr=(@sefac*cd/2+ed)/(cd*@sefac) endif endif if @sevar==2 if abs(ed/cd)<@sefac tr=(@sefac*cd+ed)/(cd*@sefac) endif endif ; j=@pts endif;voor@se endif kol2=rgba(red(kol), green(kol), blue(kol), tr) endif endif; voor @trans if @trans==false if (abs(S1+S2+S3-2*#pi)<.01 && @inv==false) ||\ (abs(S1+S2+S3-2*#pi)>.01 && (imag((c-P[j])/(P[a]-P[j]))<0 && \ imag((c-P[a])/(C1-P[a]))>0 && imag((c-C1)/(P[j]-C1))>0) && @inv); if (real(#screenpixel) + imag(#screenpixel))%2 == 0 #solid = true endif endif endif j=j+1 endwhile #color = kol2 default: title = "Image Nibble" heading text = "Tip: the Image Nibble coloring algorithm works best with the standard \ Pixel fractal formula." endheading Image param imageParam caption = "Image" hint = "The image selected here will fill the entire layer, if combined \ with the Pixel fractal formula and if the location is set to the \ default. To do this, click the Reset button on the Location tab." endparam param trans caption = "Do transform" default =false endparam param inv caption = "Inverse?" default =false endparam param se caption = "Soft edges?" default =false endparam param sefac visible= @se==true caption = "Softness" default =.1 endparam param sevar visible= @se==true caption = "Which edges?" enum= "inside shape" "in/out shape" "outside shape" default =0 endparam param sap caption = "Show all nonzero points?" default =false endparam param C1 caption = "Center" default =(0,0) endparam param pts caption = "Number of points" default =4 min=3,max=100 endparam param p1 caption = "Point 1" visible= (@p2 ==(0,0)) || (@sap && 2<=@pts) default =(0,0) endparam param p2 visible= (@p1 !=(0,0) && @p3 ==(0,0) && 2<=@pts) || (@sap && 2<=@pts) caption = "Point 2" default =(0,0) endparam param p3 visible= (@p2 !=(0,0) && @p4 ==(0,0) && 3<=@pts) || (@sap && 3<=@pts) caption = "Point 3" default =(0,0) endparam param p4 visible= (@p3 !=(0,0) && @p5 ==(0,0) && 4<=@pts) || (@sap && 4<=@pts) caption = "Point 4" default =(0,0) endparam param p5 visible= (@p4 !=(0,0) && @p6 ==(0,0) && 5<=@pts) || (@sap && 5<=@pts) caption = "Point 5" default =(0,0) endparam param p6 visible= (@p5 !=(0,0) && @p7 ==(0,0) && 6<=@pts) || (@sap && 6<=@pts) caption = "Point 6" default =(0,0) endparam param p7 visible= (@p6 !=(0,0) && @p8 ==(0,0) && 7<=@pts) || (@sap && 7<=@pts) caption = "Point 7" default =(0,0) endparam param p8 visible= (@p7 !=(0,0) && @p9 ==(0,0) && 8<=@pts) || (@sap && 8<=@pts) caption = "Point 8" default =(0,0) endparam param p9 visible= (@p8 !=(0,0) && @p10 ==(0,0) && 9<=@pts) || (@sap && 9<=@pts) caption = "Point 9" default =(0,0) endparam param p10 visible= (@p9 !=(0,0) && @p11 ==(0,0) && 10<=@pts) || (@sap && 10<=@pts) caption = "Point 10" default =(0,0) endparam param p11 visible= (@p10 !=(0,0) && @p12 ==(0,0) && 11<=@pts) || (@sap && 11<=@pts) caption = "Point 11" default =(0,0) endparam param p12 visible= (@p11 !=(0,0) && @p13 ==(0,0) && 12<=@pts) || (@sap && 12<=@pts) caption = "Point 12" default =(0,0) endparam param p13 visible= (@p12 !=(0,0) && @p14 ==(0,0) && 13<=@pts) || (@sap && 13<=@pts) caption = "Point 13" default =(0,0) endparam param p14 visible= (@p13 !=(0,0) && @p15 ==(0,0) && 14<=@pts) || (@sap && 14<=@pts) caption = "Point 14" default =(0,0) endparam param p15 visible= (@p14 !=(0,0) && @p16 ==(0,0) && 15<=@pts) || (@sap && 15<=@pts) caption = "Point 15" default =(0,0) endparam param p16 visible= (@p15 !=(0,0) && @p17 ==(0,0) && 16<=@pts) || (@sap && 16<=@pts) caption = "Point 16" default =(0,0) endparam param p17 visible= (@p16 !=(0,0) && @p18 ==(0,0) && 17<=@pts) || (@sap && 17<=@pts) caption = "Point 17" default =(0,0) endparam param p18 visible= (@p17 !=(0,0) && @p19 ==(0,0) && 18<=@pts) || (@sap && 18<=@pts) caption = "Point 18" default =(0,0) endparam param p19 visible= (@p18 !=(0,0) && @p20 ==(0,0) && 19<=@pts) || (@sap && 19<=@pts) caption = "Point 19" default =(0,0) endparam param p20 visible= (@p19 !=(0,0) && @p21 ==(0,0) && 20<=@pts) || (@sap && 20<=@pts) caption = "Point 20" default =(0,0) endparam param p21 visible= (@p20 !=(0,0) && @p22 ==(0,0) && 21<=@pts) || (@sap && 21<=@pts) caption = "Point 21" default =(0,0) endparam param p22 visible= (@p21 !=(0,0) && @p23 ==(0,0) && 22<=@pts) || (@sap && 22<=@pts) caption = "Point 22" default =(0,0) endparam param p23 visible= (@p22 !=(0,0) && @p24 ==(0,0) && 23<=@pts) || (@sap && 23<=@pts) caption = "Point 23" default =(0,0) endparam param p24 visible= (@p23 !=(0,0) && @p25 ==(0,0) && 24<=@pts) || (@sap && 24<=@pts) caption = "Point 24" default =(0,0) endparam param p25 visible= (@p24 !=(0,0) && @p26 ==(0,0) && 25<=@pts) || (@sap && 25<=@pts) caption = "Point 25" default =(0,0) endparam param p26 visible= (@p25 !=(0,0) && @p27 ==(0,0) && 26<=@pts) || (@sap && 26<=@pts) caption = "Point 26" default =(0,0) endparam param p27 visible= (@p26 !=(0,0) && @p28 ==(0,0) && 27<=@pts) || (@sap && 27<=@pts) caption = "Point 27" default =(0,0) endparam param p28 visible= (@p27 !=(0,0) && @p29 ==(0,0) && 28<=@pts) || (@sap && 28<=@pts) caption = "Point 28" default =(0,0) endparam param p29 visible= (@p28 !=(0,0) && @p30 ==(0,0) && 29<=@pts) || (@sap && 29<=@pts) caption = "Point 29" default =(0,0) endparam param p30 visible= (@p29 !=(0,0) && @p31 ==(0,0) && 30<=@pts) || (@sap && 30<=@pts) caption = "Point 30" default =(0,0) endparam param p31 visible= (@p30 !=(0,0) && @p32 ==(0,0) && 31<=@pts) || (@sap && 31<=@pts) caption = "Point 31" default =(0,0) endparam param p32 visible= (@p31 !=(0,0) && @p33 ==(0,0) && 32<=@pts) || (@sap && 32<=@pts) caption = "Point 32" default =(0,0) endparam param p33 visible= (@p32 !=(0,0) && @p34 ==(0,0) && 33<=@pts) || (@sap && 33<=@pts) caption = "Point 33" default =(0,0) endparam param p34 visible= (@p33 !=(0,0) && @p35 ==(0,0) && 34<=@pts) || (@sap && 34<=@pts) caption = "Point 34" default =(0,0) endparam param p35 visible= (@p34 !=(0,0) && @p36 ==(0,0) && 35<=@pts) || (@sap && 35<=@pts) caption = "Point 35" default =(0,0) endparam param p36 visible= (@p35 !=(0,0) && @p37 ==(0,0) && 36<=@pts) || (@sap && 36<=@pts) caption = "Point 36" default =(0,0) endparam param p37 visible= (@p36 !=(0,0) && @p38 ==(0,0) && 37<=@pts) || (@sap && 37<=@pts) caption = "Point 37" default =(0,0) endparam param p38 visible= (@p37 !=(0,0) && @p39 ==(0,0) && 38<=@pts) || (@sap && 38<=@pts) caption = "Point 38" default =(0,0) endparam param p39 visible= (@p38 !=(0,0) && @p40 ==(0,0) && 39<=@pts) || (@sap && 39<=@pts) caption = "Point 39" default =(0,0) endparam param p40 visible= (@p39 !=(0,0) && @p41 ==(0,0) && 40<=@pts) || (@sap && 40<=@pts) caption = "Point 40" default =(0,0) endparam param p41 visible= (@p40 !=(0,0) && @p42 ==(0,0) && 41<=@pts) || (@sap && 41<=@pts) caption = "Point 41" default =(0,0) endparam param p42 visible= (@p41 !=(0,0) && @p43 ==(0,0) && 42<=@pts) || (@sap && 42<=@pts) caption = "Point 42" default =(0,0) endparam param p43 visible= (@p42 !=(0,0) && @p44 ==(0,0) && 43<=@pts) || (@sap && 43<=@pts) caption = "Point 43" default =(0,0) endparam param p44 visible= (@p43 !=(0,0) && @p45 ==(0,0) && 44<=@pts) || (@sap && 44<=@pts) caption = "Point 44" default =(0,0) endparam param p45 visible= (@p44 !=(0,0) && @p46 ==(0,0) && 45<=@pts) || (@sap && 45<=@pts) caption = "Point 45" default =(0,0) endparam param p46 visible= (@p45 !=(0,0) && @p47 ==(0,0) && 46<=@pts) || (@sap && 46<=@pts) caption = "Point 46" default =(0,0) endparam param p47 visible= (@p46 !=(0,0) && @p48 ==(0,0) && 47<=@pts) || (@sap && 47<=@pts) caption = "Point 47" default =(0,0) endparam param p48 visible= (@p47 !=(0,0) && @p49 ==(0,0) && 48<=@pts) || (@sap && 48<=@pts) caption = "Point 48" default =(0,0) endparam param p49 visible= (@p48 !=(0,0) && @p50 ==(0,0) && 49<=@pts) || (@sap && 49<=@pts) caption = "Point 49" default =(0,0) endparam param p50 visible= (@p49 !=(0,0) && @p51 ==(0,0) && 50<=@pts) || (@sap && 50<=@pts) caption = "Point 50" default =(0,0) endparam param p51 visible= (@p50 !=(0,0) && @p52 ==(0,0) && 51<=@pts) || (@sap && 51<=@pts) caption = "Point 51" default =(0,0) endparam param p52 visible= (@p51 !=(0,0) && @p53 ==(0,0) && 52<=@pts) || (@sap && 52<=@pts) caption = "Point 52" default =(0,0) endparam param p53 visible= (@p52 !=(0,0) && @p54 ==(0,0) && 53<=@pts) || (@sap && 53<=@pts) caption = "Point 53" default =(0,0) endparam param p54 visible= (@p53 !=(0,0) && @p55 ==(0,0) && 54<=@pts) || (@sap && 54<=@pts) caption = "Point 54" default =(0,0) endparam param p55 visible= (@p54 !=(0,0) && @p56 ==(0,0) && 55<=@pts) || (@sap && 55<=@pts) caption = "Point 55" default =(0,0) endparam param p56 visible= (@p55 !=(0,0) && @p57 ==(0,0) && 56<=@pts) || (@sap && 56<=@pts) caption = "Point 56" default =(0,0) endparam param p57 visible= (@p56 !=(0,0) && @p58 ==(0,0) && 57<=@pts) || (@sap && 57<=@pts) caption = "Point 57" default =(0,0) endparam param p58 visible= (@p57 !=(0,0) && @p59 ==(0,0) && 58<=@pts) || (@sap && 58<=@pts) caption = "Point 58" default =(0,0) endparam param p59 visible= (@p58 !=(0,0) && @p60 ==(0,0) && 59<=@pts) || (@sap && 59<=@pts) caption = "Point 59" default =(0,0) endparam param p60 visible= (@p59 !=(0,0) && @p61 ==(0,0) && 60<=@pts) || (@sap && 60<=@pts) caption = "Point 60" default =(0,0) endparam param p61 visible= (@p60 !=(0,0) && @p62 ==(0,0) && 61<=@pts) || (@sap && 61<=@pts) caption = "Point 61" default =(0,0) endparam param p62 visible= (@p61 !=(0,0) && @p63 ==(0,0) && 62<=@pts) || (@sap && 62<=@pts) caption = "Point 62" default =(0,0) endparam param p63 visible= (@p62 !=(0,0) && @p64 ==(0,0) && 63<=@pts) || (@sap && 63<=@pts) caption = "Point 63" default =(0,0) endparam param p64 visible= (@p63 !=(0,0) && @p65 ==(0,0) && 64<=@pts) || (@sap && 64<=@pts) caption = "Point 64" default =(0,0) endparam param p65 visible= (@p64 !=(0,0) && @p66 ==(0,0) && 65<=@pts) || (@sap && 65<=@pts) caption = "Point 65" default =(0,0) endparam param p66 visible= (@p65 !=(0,0) && @p67 ==(0,0) && 66<=@pts) || (@sap && 66<=@pts) caption = "Point 66" default =(0,0) endparam param p67 visible= (@p66 !=(0,0) && @p68 ==(0,0) && 67<=@pts) || (@sap && 67<=@pts) caption = "Point 67" default =(0,0) endparam param p68 visible= (@p67 !=(0,0) && @p69 ==(0,0) && 68<=@pts) || (@sap && 68<=@pts) caption = "Point 68" default =(0,0) endparam param p69 visible= (@p68 !=(0,0) && @p70 ==(0,0) && 69<=@pts) || (@sap && 69<=@pts) caption = "Point 69" default =(0,0) endparam param p70 visible= (@p69 !=(0,0) && @p71 ==(0,0) && 70<=@pts) || (@sap && 70<=@pts) caption = "Point 70" default =(0,0) endparam param p71 visible= (@p70 !=(0,0) && @p72 ==(0,0) && 71<=@pts) || (@sap && 71<=@pts) caption = "Point 71" default =(0,0) endparam param p72 visible= (@p71 !=(0,0) && @p73 ==(0,0) && 72<=@pts) || (@sap && 72<=@pts) caption = "Point 72" default =(0,0) endparam param p73 visible= (@p72 !=(0,0) && @p74 ==(0,0) && 73<=@pts) || (@sap && 73<=@pts) caption = "Point 73" default =(0,0) endparam param p74 visible= (@p73 !=(0,0) && @p75 ==(0,0) && 74<=@pts) || (@sap && 74<=@pts) caption = "Point 74" default =(0,0) endparam param p75 visible= (@p74 !=(0,0) && @p76 ==(0,0) && 75<=@pts) || (@sap && 75<=@pts) caption = "Point 75" default =(0,0) endparam param p76 visible= (@p75 !=(0,0) && @p77 ==(0,0) && 76<=@pts) || (@sap && 76<=@pts) caption = "Point 76" default =(0,0) endparam param p77 visible= (@p76 !=(0,0) && @p78 ==(0,0) && 77<=@pts) || (@sap && 77<=@pts) caption = "Point 77" default =(0,0) endparam param p78 visible= (@p77 !=(0,0) && @p79 ==(0,0) && 78<=@pts) || (@sap && 78<=@pts) caption = "Point 78" default =(0,0) endparam param p79 visible= (@p78 !=(0,0) && @p80 ==(0,0) && 79<=@pts) || (@sap && 79<=@pts) caption = "Point 79" default =(0,0) endparam param p80 visible= (@p79 !=(0,0) && @p81 ==(0,0) && 80<=@pts) || (@sap && 80<=@pts) caption = "Point 80" default =(0,0) endparam param p81 visible= (@p80 !=(0,0) && @p82 ==(0,0) && 81<=@pts) || (@sap && 81<=@pts) caption = "Point 81" default =(0,0) endparam param p82 visible= (@p81 !=(0,0) && @p83 ==(0,0) && 82<=@pts) || (@sap && 82<=@pts) caption = "Point 82" default =(0,0) endparam param p83 visible= (@p82 !=(0,0) && @p84 ==(0,0) && 83<=@pts) || (@sap && 83<=@pts) caption = "Point 83" default =(0,0) endparam param p84 visible= (@p83 !=(0,0) && @p85 ==(0,0) && 84<=@pts) || (@sap && 84<=@pts) caption = "Point 84" default =(0,0) endparam param p85 visible= (@p84 !=(0,0) && @p86 ==(0,0) && 85<=@pts) || (@sap && 85<=@pts) caption = "Point 85" default =(0,0) endparam param p86 visible= (@p85 !=(0,0) && @p87 ==(0,0) && 86<=@pts) || (@sap && 86<=@pts) caption = "Point 86" default =(0,0) endparam param p87 visible= (@p86 !=(0,0) && @p88 ==(0,0) && 87<=@pts) || (@sap && 87<=@pts) caption = "Point 87" default =(0,0) endparam param p88 visible= (@p87 !=(0,0) && @p89 ==(0,0) && 88<=@pts) || (@sap && 88<=@pts) caption = "Point 88" default =(0,0) endparam param p89 visible= (@p88 !=(0,0) && @p90 ==(0,0) && 89<=@pts) || (@sap && 89<=@pts) caption = "Point 89" default =(0,0) endparam param p90 visible= (@p89 !=(0,0) && @p91 ==(0,0) && 90<=@pts) || (@sap && 90<=@pts) caption = "Point 90" default =(0,0) endparam param p91 visible= (@p90 !=(0,0) && @p92 ==(0,0) && 91<=@pts) || (@sap && 91<=@pts) caption = "Point 91" default =(0,0) endparam param p92 visible= (@p91 !=(0,0) && @p93 ==(0,0) && 92<=@pts) || (@sap && 92<=@pts) caption = "Point 92" default =(0,0) endparam param p93 visible= (@p92 !=(0,0) && @p94 ==(0,0) && 93<=@pts) || (@sap && 93<=@pts) caption = "Point 93" default =(0,0) endparam param p94 visible= (@p93 !=(0,0) && @p95 ==(0,0) && 94<=@pts) || (@sap && 94<=@pts) caption = "Point 94" default =(0,0) endparam param p95 visible= (@p94 !=(0,0) && @p96 ==(0,0) && 95<=@pts) || (@sap && 95<=@pts) caption = "Point 95" default =(0,0) endparam param p96 visible= (@p95 !=(0,0) && @p97 ==(0,0) && 96<=@pts) || (@sap && 96<=@pts) caption = "Point 96" default =(0,0) endparam param p97 visible= (@p96 !=(0,0) && @p98 ==(0,0) && 97<=@pts) || (@sap && 97<=@pts) caption = "Point 97" default =(0,0) endparam param p98 visible= (@p97 !=(0,0) && @p99 ==(0,0) && 98<=@pts) || (@sap && 98<=@pts) caption = "Point 98" default =(0,0) endparam param p99 visible= (@p98 !=(0,0) && @p100 ==(0,0) && 99<=@pts) || (@sap && 99<=@pts) caption = "Point 99" default =(0,0) endparam param p100 visible= (@p99 !=(0,0) && 100<=@pts) || (@sap && 100<=@pts) caption = "Point 100" default =(0,0) endparam } Droste_effect { ;by Jos Leys, March 2006 ; Suitable for turning any ring shape into a spiral, ; or for making "Droste effect" movies ;Mini tutorial ; This will only work on imported images. Use with the Pixel formula. ;PATTERN : ; "Circular" for a circular area within a circular area. ; "Rectangular" for a rectangular area within a rectangular area. ; "Transparency detection" for use on images where a shape has been ; made transparent (PNG format). (This can be done in a graphics program ; like Photoshop or in Ultrafractal, using the "Image Nibble" UCL in jos.ucl.) ; MODE : ; "Crop" to determine area to be transformed. ; "Transform" to kick off the transformation. ; The small rectangle or circle should be inside the large one. ; Results are not guaranteed if this condition is not met. ;VARIATION : ( put STAGE parameter on "TWO" ) ; "Zero" produces endless repetition of a large image in a small image ; "Alfa" produces a spiral with seamless repetition. ; "180-alfa" "180" and "180+alfa" produce more distorted "inside out" images ;STAGE : ; "One" is an intermediate stage in the imagetransform, but can produce ; interesting results. ; "Two" is the intended end result stage ;"RADIUS": (Pattern=Circular): radius of large circle. ;"WIDTH/HEIGHT" :(Pattern=Rectangular) for large rectangle ;"PROPORTION small/large": ratio of dimension of small circle/rectangle/shape ; over large one ;"ROTATION" :(Pattern=Rectangular/Transparency detection) rotation in degrees ; of small rectangle vs. large rectangle. (Rectangular), or rotation of large ; shape vs. small shape (Transparency detection) ;"CENTER LARGE/SMALL": coordinates of centers : shown as crosshairs in CROP mode ; With the Circular and Rectangular patterns the centers are the exact centers of ; the circle/rectangle. ; With Transparency detection the 'center' is not the geometric center. ; (For Center Small, pick a point anywhere in the transparent shape. ) ;The third "cross" crosshair shows the position of the limit centre. ; "COMPILER MESSAGES": turn on or off ; For a "Droste effect zoom movie",read calculated values in the compiler messages : ; ( c= limit centre (center of spiral/picture-in-picture), just for information ) ; An identical image is obtained with the values from the compiler messages! ; set image center to 'new center' ; set magnification to 'new magnification' ; set rotation angle to 'new rotation' ; This will produce an identical image to the original. ; Interpolation via animation between the original and the new image ; produces a Droste effect movie ( play in loop mode) ; ; Thanks to Antonio Chiesa for testing.. global: $define debug if @cm $define debug endif float rot=@rot*#pi/180,float rot2=rot if @pat==2, rot2=-rot, endif complex plar=0,float rad=0,float radin=0 if @pat==0,rot=0,endif complex i= (0.0,1.0) complex c=@cenlarge+(@censmall-@cenlarge)/(1-@fac*exp(i*rot2)) Image im = new @imageParam complex D1 float Wi = im.getWidth() float He= im.getHeight() float ratio=Wi/He float func findrimglob( complex p) A=c,B=p, float epsilon=1E20 while epsilon>.0000001 D=(A+B)/2, color kol= im.getColor(real(D/2) + flip(imag(D/2) * ratio)) float td=alpha(kol) if td<0.9,A=D,else, B=D,endif D1=(A+B)/2 epsilon=cabs(D-D1) endwhile return cabs(D1-c) endfunc IF @pat==1 plar=@cenlarge+@wid/2+i*@heig/2 rad=real(plar-c), radin=rad*@fac endif if @pat==0 rad=@rad-cabs(c-@cenlarge),radin=rad*@fac endif if @pat==2 P=c+(2-real(c))*.999 ;*exp(i*rot)/cos(rot) if imag(P)>2/ratio P=c+(2/ratio-imag(c))*.999;*exp(i*rot)/sin(rot) endif radin=findrimglob(P) endif float d=1/@fac complex m= 0 float alfa=0 float sc=0 if @var==0 ;zero sc=1,alfa=0 elseif @var==1 ;alfa m= 2*#pi-rot+i*log(d) alfa=atan2(m) sc=cos(alfa)*2*#pi/(2*#pi-rot) elseif @var==2 ; 180-alfa m= 2*#pi-rot+i*log(d) alfa=atan2(m) sc=cos(alfa)*2*#pi/(2*#pi-rot),alfa=#pi+alfa elseif @var==3 ;180 sc=1,alfa=#pi elseif @var==4; 180+alfa m= 2*#pi+rot+i*log(d) alfa=atan2(m) sc=cos(alfa)*2*#pi/(2*#pi+rot),alfa=#pi-alfa elseif @var==5 ; -alfa m= 2*#pi+rot+i*log(d) alfa=atan2(m) sc=cos(alfa)*2*#pi/(2*#pi+rot),alfa=2*#pi-alfa endif float beta=atan(rot2/log(d)) COMPLEX scale=d^(sc*exp(i*(alfa-beta))/cos(beta)) if cabs(scale)<1,scale=1/scale,endif float scalesize=cabs(scale) float scaleangle=atan2(scale) print("c=",c) print("scaleangle=",-scaleangle*180/#pi) print("new center=",c+(#center-c)/scale) print("new magnification=",scalesize*#magn) print("new rotation=",(#angle-scaleangle)*180/#pi) final: float func findrim( complex p) A=c,B=p, float epsilon=1E20,complex D3=0 while epsilon>.0001 D2=(A+B)/2, color kol2= im.getColor(real(D2/2) + flip(imag(D2/2) * ratio)) float td2=alpha(kol2) if td2<0.9,A=D2,else, B=D2,endif complex D3=(A+B)/2 epsilon=cabs(D2-D3) endwhile return cabs(D3-c) endfunc float dist=0 float dik=@wid/100 if @pat==0 dik=@rad/100 endif FLOAT x=0 FLOAT y=0 float os=0 float os1=0 complex pt1=0,complex pt2=0 float h1=0 float h2=0 float h3=0 float h4=0 z=#pixel if @mode=="Crop" bool inshape=false color kol4= im.getColor(real(z/2) + flip(imag(z/2) * ratio)) if @pat==2 if alpha(im.getColor(real(z/2) + flip(imag(z/2) * ratio)))>0 float in=findrim(z) float out=findrim(c+(z-c)*exp(i*rot))*d if cabs (z-c)in inshape=true if (real(#screenpixel) + imag(#screenpixel))%2 == 0 color kol4=rgba(0, 0, 0, 1) endif endif endif endif if @pat==1 if ((abs(real(z-@cenlarge))<@wid/2 && abs(imag(z-@cenlarge))<@heig/2 ) && \ (abs(real((z-@censmall)*exp(-i*rot)))>@wid*@fac/2 || \ abs(imag((z-@censmall)*exp(-i*rot)))>@heig*@fac/2) ) || \ (abs(real((z-@censmall)*exp(-i*rot)))<@wid*@fac/2 && \ abs(imag((z-@censmall)*exp(-i*rot)))<@heig*@fac/2 && \ (abs(real(z-@cenlarge))>@wid/2 || abs(imag(z-@cenlarge))>@heig/2 )) inshape=true if (real(#screenpixel) + imag(#screenpixel))%2 == 0 color kol4=rgba(0, 0, 0, 1) endif endif endif if @pat==0 if (cabs(z-@cenlarge)<@rad && cabs(z-@censmall)>@rad*@fac) || \ (cabs(z-@cenlarge)>@rad && cabs(z-@censmall)<@rad*@fac) inshape=true if (real(#screenpixel) + imag(#screenpixel))%2 == 0 color kol4=rgba(0, 0, 0, 1) endif endif ENDIF float ptn=0 if @pat==0 ptn=@rad else ptn=@wid endif int cnt=1 while cnt<7 if cnt==1, pt1=@cenlarge+ptn/25, pt2=@cenlarge-ptn/25 elseif cnt==2,pt1=@cenlarge+i*ptn/25,pt2=@cenlarge-i*ptn/25 elseif cnt==3,pt1=@censmall+ptn/25, pt2=@censmall-ptn/25 elseif cnt==4,pt1=@censmall+i*ptn/25,pt2=@censmall-i*ptn/25 elseif cnt==5,pt1=c+ptn/40*exp(i*#pi/4), pt2=c+ptn/40*exp(i*5*#pi/4) elseif cnt==6,pt1=c+ptn/40*exp(i*3*#pi/4),pt2=c+ptn/40*exp(i*7*#pi/4) endif test1 = (z-pt2)/(pt1-pt2) if real(test1)<0 dist=cabs(test1) elseif real(test1)>1 dist=cabs(test1-1) else dist=abs(imag(test1)) endif dist=dist*cabs(pt2-pt1) if dist0 x=real(z)-(log(d))*trunc((real(z))/log(d)) y=imag(z)+rot*trunc((real(z))/log(d)) else x=real(z)-(log(d))*floor((real(z))/log(d)) y=imag(z)+rot*floor((real(z))/log(d)) endif if y>0 y=y-2*#pi*trunc(y/(2*#pi)) else y=y-2*#pi*floor(y/(2*#pi)) endif float yy=0 float yyy=0 bool cond=true float rot1=0 while cond==true IF @pat==2 float yy=y, if yy<0,yy=yy+2*pi,endif, if yy>2*#pi,yy=yy-2*pi,endif if yy<=h1 || yy>h4 os=log(findrim(c+(2-real(c))*exp(i*yy)/cos(yy))/radin) elseif yy<=h2 && yy>h1 os=log(findrim(c+(2/ratio-imag(c))*exp(i*yy)/sin(yy))/radin) elseif yy<=h3 && yy>h2 os=log(findrim(c+(real(c)+2)/cos(yy-#pi)*exp(i*yy))/radin) elseif yy<=h4 && yy>h3 os=log(findrim(c+(2/ratio+imag(c))/cos(yy-3*#pi/2)*exp(i*yy))/radin) endif float yyy=y+rot, if yyy>2*pi,yyy=yyy-2*pi,endif, if yyy<0,yyy=yyy+2*pi,endif if yyy<=h1 || yyy>h4 os1=log(findrim(c+(2-real(c))*exp(i*yyy)/cos(yyy))/radin) elseif yyy<=h2 && yyy>h1 os1=log(findrim(c+(2/ratio-imag(c))*exp(i*yyy)/sin(yyy))/radin) elseif yyy<=h3 && yyy>h2 os1=log(findrim(c+(2+real(c))/cos(yyy-#pi)*exp(i*yyy))/radin) elseif yyy<=h4 && yyy>h3 os1=log(findrim(c+(2/ratio+imag(c))/cos(yyy-3*#pi/2)*exp(i*yyy))/radin) endif if xos1 + log(d) x=x-log(d), y=y+rot, else cond=false endif endif ; voor pat==2 IF @pat==1 float yy=y-rot, if yy<0,yy=yy+2*pi,endif if yy<=h1 || yy>h4 os=log(1/abs(cos(yy))) elseif ( yy>h1 && yy<=h2) os=log(tan(h1)/abs(sin(yy))) elseif ( yy>h2 && yy<=h3) os=log((tan(h1)/tan(#pi-h2)/abs(cos(yy)))) elseif ( yy>h3 && yy<=h4) os=log(tan(h1)/tan(#pi-h2)/tan(3*#pi/2-h3)/abs(sin(yy))) endif float yyy=y, if yyy>2*pi,yyy=yyy-2*pi,endif, if yyy<0,yyy=yyy+2*pi,endif if yyy<=h1 || yyy>h4 os1=log(1/abs(cos(yyy))) elseif ( yyy>h1 && yyy<=h2) os1=log(tan(h1)/abs(sin(yyy))) elseif ( yyy>h2 && yyy<=h3) os1=log((tan(h1)/tan(#pi-h2)/abs(cos(yyy)))) elseif ( yyy>h3 && yyy<=h4) os1=log(tan(h1)/tan(#pi-h2)/tan(3*#pi/2-h3)/abs(sin(yyy))) endif if xos1 + log(d) x=x-log(d), y=y+rot, else cond=false endif endif ; voor pat==1 if @pat==0 rot1=atan2(c-@cenlarge),if rot1<0,rot1=rot1+2*#pi,endif float cc=cabs(c-@cenlarge) float yy=y-rot1, if yy<0,yy=yy+2*pi,endif os=log((sqrt(@rad^2-cc*cc*sin(yy)*sin(yy))- cc*cos(yy))/(rad)) ; if x0 endparam param censmall caption = "Center small" default = (.5,.5) endparam param cenlarge caption = "Center large" default = (0.0,0.0) endparam param cm caption = "Compiler messages?" default = false endparam } ImageFrac { ; Jos Leys , January 2011 $define debug global: Image im = new @imageParam final: complex i=(0,1) complex pp = .5 * (#pixel-@imagecen)*exp(i*@rot*#pi/180)/@imagesize float ratio if !im.getEmpty() ratio = im.getWidth() / im.getHeight() else ratio = 1 endif color kol= im.getColor(real(pp) + flip(imag(pp) * ratio)) ;p=#pixel if @frac z=0,c=#pixel,if @Jul,z=#pixel,c=@seed,endif int u=0,while u<@its && cabs(z)<@bailout u=u+1,z=z^@pow+c if u>@itskip p=.5 * (z-@imagecen)*exp(i*@rot*#pi/180)/@imagesize color kol= im.getColor(real(p) + flip(imag(p) * ratio)) float td=alpha(kol) if td>0,u=@its,endif endif endwhile ;pp = p;.5 * (z-@imagecen)*exp(i*@rot*#pi/180)/@imagesize endif print(u," ",kol) #color = kol; im.getColor(real(pp) + flip(imag(pp) * ratio)) default: title = "Image Fractal" Image param imageParam caption = "Image" endparam param imagesize caption = "Image size" default= 1.0 endparam param imagecen caption = "Image center" default= (0.0,0.0) endparam param rot caption = "Image rotation (degrees)" default= 0.0 endparam param frac caption = "Fractal?" default= false endparam param Jul caption = "Julia?" default= false visible=@frac==true endparam param seed caption = "Seed" default= (0.25,0) visible=@Jul==true && @frac==true endparam param pow caption = "Power" default= 2 visible=@frac==true endparam param bailout caption = "Bailout" default= 4 visible=@frac==true endparam param its caption = "Iterations" default= 20 visible=@frac==true endparam param itskip caption = "Skip Iterations" default= 0 visible=@frac==true endparam }