STAR Algorithm
- the parameter of the algorithm are : Center , radius ,Number of vertex , color
J I
P3,P4 P1
P4,P5 P2
P5 P3
We have 1<= i<=N-2
I+2<=J<=N Else I=1 and J=N
Algorithm of Color_Star(Xc,Yc,r,N,color)
Begin
Call Star(Xc,Yc,r,N,color)
Call Star(Xc,Yc,r-(r div 2),N,0)
Call Fillshape(Xc,Yc,color,Color)
End{ algorithm}
Algorithm of Star(Xc,Yc,r,N,color)
Begin
Twopi=6.283186
Theta=0
Incr= Twopi/N
For k=1 to N do
Begin
X[k]= Round (Xc+r*Cos(theta)
Y[k]= Round (Yc+r*Sin(theta)
Theta=Theta+incr
End{for k}
For i=1 to N-2 do
For j=i+2 to N do
If not((i=1) and (j=N)) then
Call LineDDA(X[i],Y[i],X[j],Y[j],color)
End {end Algorithm}
STAR Algorithm
- the parameter of the algorithm are : Center , radius ,Number of vertex , color
J I
P3,P4 P1
P4,P5 P2
P5 P3
We have 1<= i<=N-2
I+2<=J<=N Else I=1 and J=N
Algorithm of Color_Star(Xc,Yc,r,N,color)
Begin
Call Star(Xc,Yc,r,N,color)
Call Star(Xc,Yc,r-(r div 2),N,0)
Call Fillshape(Xc,Yc,color,Color)
End{ algorithm}
Algorithm of Star(Xc,Yc,r,N,color)
Begin
Twopi=6.283186
Theta=0
Incr= Twopi/N
For k=1 to N do
Begin
X[k]= Round (Xc+r*Cos(theta)
Y[k]= Round (Yc+r*Sin(theta)
Theta=Theta+incr
End{for k}
For i=1 to N-2 do
For j=i+2 to N do
If not((i=1) and (j=N)) then
Call LineDDA(X[i],Y[i],X[j],Y[j],color)
End {end Algorithm}