果然是判断出了漏洞,重新对五个判断更改后,正常了。
五环旗五环图案陷阱 {
;20140620柳烟作
init:
int iter = 0
float x = 0
float y = 0
float xo1=0
float yo1=0
float xo2=0
float yo2=0
float xo3=0
float yo3=0
float xo4=0
float yo4=0
float xo5=0
float yo5=0
float l1=0
float l2=0
float l3=0
float l4=0
float d1=0
float d2=0
float d3=0
float d4=0
float d5=0
float Zt = 0
float Rc = @r
float H = 0.11027*Rc
float CI=0
float ID=0
bool Tr = false
loop:
iter= iter + 1
x = real(#z)
y = imag(#z)
xo1=-2.42756*Rc+ @ox
yo1= @oy
xo2=@ox
yo2=@oy
xo3=2.42756*Rc+ @ox
yo3=@oy
xo4=-1.21378*Rc+@ox
yo4=-0.99592*Rc+@oy
xo5=1.21378*Rc+@ox
yo5=-0.99592*Rc+@oy
d1=abs(sqrt((x-xo1)^2+(y-yo1)^2)-Rc)
d2=abs(sqrt((x-xo2)^2+(y-yo2)^2)-Rc)
d3=abs(sqrt((x-xo3)^2+(y-yo3)^2)-Rc)
d4=abs(sqrt((x-xo4)^2+(y-yo4)^2)-Rc)
d5=abs(sqrt((x-xo5)^2+(y-yo5)^2)-Rc)
l1=(yo4-yo1)*x-(xo4-xo1)*y+(xo4*yo1-yo4*xo1)
l2=(yo2-yo4)*x-(xo2-xo4)*y+(xo2*yo4-yo2*xo4)
l3=(yo5-yo2)*x-(xo5-xo2)*y+(xo5*yo2-yo5*xo2)
l4=(yo3-yo5)*x-(xo3-xo5)*y+(xo3*yo5-yo3*xo5)
if iter > @skip
if (@rangevar==0&&!Tr) ||(@rangevar==1)
if (l1<0||(l1>0&&d4>H))&&(d1<H)
ID=iter
Zt= d1
Tr= true
CI=1
elseif ((l2<0&&l3>0&&d4>H)||(l3>0&&l2>0&&d5>H)||l3<0)&&(d2<H)
ID=iter
Zt= d2
Tr= true
CI=2
elseif ((l4<0&&d5>H)||l4>0)&&(d3<H)
ID=iter
Zt= d3
Tr= true
CI=3
elseif (l1>0||(l1<0&&l2<0&&d1>H)||(l1<0&&l2>0&&d2>H))&&(d4<H)
ID=iter
Zt= d4
Tr= true
CI=4
elseif ((l3<0&&l4<0&&d2>H)||(l3<0&&l4>0&&d3>H)||l3>0)&&(d5<H)
ID=iter
Zt= d5
Tr= true
CI=5
endif
endif
endif
final:
if !Tr
#solid=true
else
CI = (@off+ID)%7
float Ratio = Zt/H
float ColorIndex = 29 * Ratio + CI* 30
#index = (ColorIndex +60) % 256 /256
endif
default:
title = "五环旗五环图案陷阱柳烟20140620"
param r
caption = "Rc"
default = 0.12534
endparam
param ox
caption = "ox"
default =0.0000
endparam
param oy
caption = "oy"
default =0.0000
endparam
param rangevar
caption="range variable"
default=0
enum="先上后下" "后来居上"
endparam
param off
caption = "off"
default =1
endparam
param skip
caption = "skip"
default =0
endparam
}
非常好看。 |