前面五角星科赫雪花,为什么在画板中没问题,当我将画板算法移置到UF中,为什么有一个五角星不正常?算法完全与画板算法一致。已经干了几天了,无果。
附有问题的UF代码:
五角星科赫雪花20150205 {
init:
z = pixel
s=0.61803
loop:
x = real(z)
y = imag(z)
L13=-y+0.30902
L35=1.11803*x+1.53884*y+0.587785
L25=1.80902*x+0.587785*y-0.587785
L24=1.80902*x-0.587785*y+0.587785
L14=1.11803*x-1.53884*y-0.587785
L1=0.32492*x+y
L2=1.37638*x-y
L3=1.37638*x+y
L4=0.32492*x-y
m1=x-(1+s)*0.95106
n1=y-(1+s)*0.30902
m2=x-(1+s)*0.58779
n2=y+(1+s)*0.80902
n3=x+(1+s)*0.58779
if L1>0&&L2>0
x=1/s*(m1*cos(-pi/5)-n1*sin(-pi/5))
y=1/s*(m1*sin(-pi/5)+n1*cos(-pi/5))
elseif L2<0&&y>0
x=1/s*(x*cos(-3*pi/5)-(y-(1+s))*sin(-3*pi/5))
y=1/s*(x*sin(-3*pi/5)+(y-(1+s))*cos(-3*pi/5))elseif x>0&&L1<0
x=1/s*(m2*cos(pi/5)-n2*sin(pi/5))
y=1/s*(m2*sin(pi/5)+n2*cos(pi/5))
elseif x<=0&&y<=0
x=1/s*(n3*cos(3*pi/5)-n2*sin(3*pi/5))
y=1/s*(n3*sin(3*pi/5)+n2*cos(3*pi/5))
endif
z=x+1i*y
bailout:
(L13<=0&&L24>=0&&L25>=0)||(L13<=0&&L24<0)||(L14>=0&&L13>0&&L25>=0&&L35>=0)||(L14>=0&&L35<0)||(L13>0&&L35<0&&L24<0&&L14<0)
default:
title = "五角星科赫雪花20150205"
helpfile = "sam-help/various.htm"
helptopic = "sierp2"
center = (0,0)
}
红色部分,画板也是照这样整的,正常,在UF中,这区块的五角星不正常。 |