Discussion:
3d sphere space fill with volume adjusted probability in 4 transforms
(too old to reply)
Roger L. Bagula
2004-06-12 20:27:36 UTC
Permalink
IMPROVED VERSION OF THE 4 PART SPACE FILL OF A SPHERE
DUE TO WILLIAM VAN DUYN.
I'M POSTING THE PICTURE TO ALT.FRACTALS
TRUE BASIC PROGRAM:
SET MODE "color"
SET WINDOW 0,1920,0,1024
SET BACKGROUND COLOR "white"
LET x=.2
LET y=.3
LET a=0
LET b =0
LET s1=400
LET s2 =s1*1024/1920
RANDOMIZE
LET z=rnd
PRINT" Circle Cantor set I.F.S. space filling sphere 4 transforms"
Print" adjusted by William van Duyn's Cantor set"
PRINT" BY R.L.BAGULA 12 June 2004 ©"
LET r=0.1
FOR n= 1 TO 1000000
LET a =RND
LET b=RND
IF a<= 1/4 AND a>0 THEN
LET t1=t/2
LET p1=p/2
LET r=(4*a)^(1/3)
SET COLOR "black"
END IF
IF a<=1/2 AND a>1/4 THEN
LET t1=t/2-1/2
LET p1=p/2
LET r=(4*a-1)^(1/3)
SET COLOR "red"
END IF
IF a<= 3/4 AND a>1/2 THEN
LET t1=t/2
LET p1=p/2-1/2
LET r=(4*a-2)^(1/3)
SET COLOR "blue"
END IF
IF a<= 1 AND a>3/4 THEN
LET t1=t/2-1/2
LET p1=p/2-1/2
LET r=(4*a-3)^(1/3)
SET COLOR "green"
END IF

LET t=t1
LET p=p1
REM disk to Sphere projection
LET x=r*cos(t*2*Pi)*Sin(Pi*p)
LET y=r*sin(t*2*Pi)*Sin(Pi*p)
LET z=r*Cos(Pi*p)
REM projection of views
LET x2=Cos(Pi/2)*x-Sin(Pi/2)*z
LET z2=Cos(Pi/2)*z+Sin(Pi/2)*x
LET y3=Cos(-Pi/2)*y-Sin(-Pi/2)*z
LET z3=Cos(-Pi/2)*z+Sin(-Pi/2)*y

IF n>10 THEN PLOT 1920/2+s1*(x/(1+z/4))-450,1024/2+s2*(y/(1+z/4))-150
IF n>10 THEN PLOT
1920/2+s1*(x2/(1+z2/4))+450,1024/2+s2*(y/(1+z2/4))-150
IF n>10 THEN PLOT 1920/2+s1*(x/(1+z3/4)),1024/2+s2*(y3/(1+z3/4))+275
NEXT n
END
Roger L. Bagula
2004-06-13 13:55:44 UTC
Permalink
This uses a fudge flake tiling to give a three transform sphere
space fill, but you can't distinguish the color sections
like in the van Duyn Cantor approach.
True basic:
SET MODE "color"
SET WINDOW 0,1920,0,1024
SET BACKGROUND COLOR "white"
LET x=.2
LET y=.3
LET a=0
LET b =0
LET s1=400
LET s2 =s1*1024/1920
RANDOMIZE
LET z=rnd

PRINT" Circle Cantor set I.F.S. space filling sphere 3 transforms"
PRINT" FUDGE FLAKE AFFINE SET"
PRINT" BY R.L.BAGULA 12 June 2004 ©"
LET r=0.1
FOR n= 1 TO 1000000
LET a =RND
LET r0=Sqr(3)
IF a<= 1/3 AND a>0 THEN
LET T1=P/r0+1+1
LET P1=-T/r0
LET r=(3*a)^(1/3)
SET COLOR "black"
END IF
IF a<= 2/3 AND a>1/3 THEN
LET T1=P/r0-1/2+1
LET P1=-T/r0+sqr(3)/2
LET r=(3*a-1)^(1/3)
SET COLOR "blue"
END IF
IF a<= 1 AND a>2/3 THEN
LET T1=P/r0-1/2+1
LET P1=-T/r0-sqr(3)/2
LET r=(3*a-2)^(1/3)
SET COLOR "RED"
END IF

LET t=t1
LET p=p1
REM disk to Sphere projection
LET x=r*cos(t*2*Pi)*Sin(Pi*p)
LET y=r*sin(t*2*Pi)*Sin(Pi*p)
LET z=r*Cos(Pi*p)
REM projection of views
LET x2=Cos(2*Pi/3)*x-Sin(2*Pi/3)*z
LET z2=Cos(2*Pi/3)*z+Sin(2*Pi/3)*x
LET y3=Cos(2*Pi/3)*y-Sin(2*Pi/3)*z
LET z3=Cos(2*Pi/3)*z+Sin(2*Pi/3)*y

IF n>10 THEN PLOT 1920/2+s1*(x/(1+z/4))-450,1024/2+s2*(y/(1+z/4))-150
IF n>10 THEN PLOT
1920/2+s1*(x2/(1+z2/4))+450,1024/2+s2*(y/(1+z2/4))-150
IF n>10 THEN PLOT 1920/2+s1*(x/(1+z3/4)),1024/2+s2*(y3/(1+z3/4))+275
NEXT n
END

Loading...