stairs Art/Electric
PROGRAMS
general
color methods
col hypercube
fuzzy logic 1
fuzzy logic 2
fuzzy logic 3
macrame
mandelzoom
julia set
ripples
sines
newtons basin
hadamard matrix
 
PROGRAMS 2
L-systems
IF-Systems
 
e-mail
COLOR - COLOR HYPERCUBE
color hypercube
color hyper cube

PROGRAM colorHypercube     ! W.van Duyn
SET MODE "color"
SET WINDOW 0,1199,0,903    !tuned to 1280x1024 monitor resolution
SET COLOR "black"
BOX AREA 10,1189,10,893
FLOOD 10,10
LET r = 251
FOR k=1 to 6
FOR i = 0 to 180
LET f=i+(k-1)*180
LET fr=f/1080
FOR j = 0 to r
LET hexa=(2*k-1)/6
LET x=(j)*sin(2*Pi*f/1080)*1/(cos(pi*(hexa-2*f/1080)))
LET y=(j)*cos(2*Pi*f/1080)*1/(cos(pi*(hexa-2*f/1080)))
LET xi = round(x) +300
LET yj = round(y) +400
CALL coltableSinC(j,fr,r)
IF j>60 THEN
BOX AREA xi,xi+1,yj,yj+1
ELSE if countj=<60 THEN
PLOT xi,yj
END IF
NEXT j
NEXT i
NEXT k
END     !end program

SUB coltableSinC(j,fr,r)
LET jr1=2*(r-j)/(r+1)
LET jr2=2*(j)/(r+1)
LET z=sqr(4)
LET ang=fr*2*pi
IF j=>0 and j LET a=z*sin(ang+9*pi/6)
LET b=z*sin(ang+5*pi/6)
LET c=z*sin(ang+1*Pi/6)
IF a>1 then let a=1     !crops the sine curve
IF b>1 then let b=1
IF c>1 then let c=1
If a<-1 then let a=-1
If b<-1 then let b=-1
If c<-1 then let c=-1
SET COLOR MIX (col)1-(1+a)*jr2/2,1-(1+b)*jr2/2,1-(1+c)*jr2/2
END IF
IF j=>round(r/2) and j<=r THEN
LET a=z*sin(ang+3*pi/6)
LET b=z*sin(ang+11*pi/6)
LET c=z*sin(ang+7*Pi/6)
IF a>1 then let a=1
IF b>1 then let b=1
IF c>1 then let c=1
If a<-1 then let a=-1
If b<-1 then let b=-1
If c<-1 then let c=-1
SET COLOR MIX (col)(1+a)*jr1/2,(1+b)*jr1/2,(1+c)*jr1/2
END IF
SET COLOR col
END SUB


Website, Text and Some Images Copyright © 2002 tzingaro.com, all rights reserved.