Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fractals > Re: 3d sphere s...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 34 of 236
Post > Topic >>

Re: 3d sphere space fill with volume adjusted probability in 4 transforms

by "Roger L. Bagula" <rlbtftn@[EMAIL PROTECTED] > Jun 12, 2004 at 08:27 PM

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
 




 2 Posts in Topic:
Re: 3d sphere space fill with volume adjusted probability in 4 t
"Roger L. Bagula&quo  2004-06-12 20:27:36 
Re: 3d sphere space fill with volume adjusted probability in 4 t
"Roger L. Bagula&quo  2004-06-13 13:55:44 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Nov 19 9:08:43 CST 2008.