Squares

General FreeBASIC programming questions.
Locked
albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0122.bas

Code: Select all


'===========================================================================

dim as single c1 , c2 , c3
dim as single s1 , s2 , s3
dim as single x1 , x2 , x3
dim as single y1 , y2 , y3
dim as single deg1 , deg2 , deg3
dim as single rad

dim as integer xctr , yctr , radius , divisions , fullcircle
dim as integer xres , yres

screeninfo xres , yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2

'radius = (xres*yres)/((xres+yres)*4)
radius = 300

divisions = 22.5

rad = atn( 1 ) / divisions

fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle step 22.5
    
            c1 = cos( deg1 * rad )
            s1 = sin( deg1 * rad )
   
            x1 = radius * c1 * c1 * s1 * atn( deg1 / c1 * rad )
            y1 = radius * s1 * s1 * c1 * atn( deg1 / s1 * rad )
            
    for deg2 = 0 to fullcircle step .025

            c2 = cos( deg2 * rad * 10 )
            s2 =  sin( deg2 * rad * 10 )
   
            x2 = radius * c2 / 2 * s1
            y2 = radius * s2 / 2 * c1
            
            deg3 = ( deg2 / deg1 + deg2 ) * 4
            c3 = cos( deg3 * rad * 4 )
            s3 = sin( deg3 * rad * 4 )
            
            x3 = radius * c1 * c1 * s1 * atn( deg3 / c1 * rad )
            y3 = radius * s1 * s1 * c1 * atn( deg3 / s1 * rad )
            
        pset( xctr +x1 +x2 +x3 , yctr +y1 +y2 +y3 ) , 9
        pset( xctr -x1   -x2  -x3 , yctr +y1 +y2 +y3 ) , 9

        pset( xctr +x1 +x2 +x3 , yctr -y1 -y2 -y3 ) , 9
        pset( xctr -x1 -x2 -x3  , yctr -y1 -y2 -y3 ) , 9
           
    next
   
next

Sleep
end

AndyA
Posts: 11
Joined: Feb 14, 2008 14:56

Re: Squares

Post by AndyA »

@AndyA

Cant you make your colorizer , so it picks colors that look good together..

like:
white , turquoise , purple and blue
red , yellow , green , blue
etc...
@Albert

You can substitute any palette, with any colors of your choosing.

1) Just replace the Hex values in the data statements with the new palette colors.
2) Dim the pal() array with the number of colors in the new palette. Change the (numberOfColors-1) in the For/Next loop to match.
3) Change the 'MOD 48' just before the psets to the number of colors in your palette.

Done!
albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0123.bas

Code: Select all


'===========================================================================

dim as single c1 , c2 , c3
dim as single s1 , s2 , s3
dim as single x1 , x2 , x3
dim as single y1 , y2 , y3
dim as single deg1 , deg2 , deg3
dim as single rad

dim as integer xctr , yctr , radius , divisions , fullcircle
dim as integer xres , yres

screeninfo xres , yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2

'radius = (xres*yres)/((xres+yres)*4)
radius = 300

divisions = 22.5

rad = atn( 1 ) / divisions

fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle step 22.5
    
            c1 = cos( deg1 * rad )
            s1 = sin( deg1 * rad )
   
            x1 = radius * c1 * c1 * s1 * atn( deg1 / c1 * rad )
            y1 = radius * s1 * s1 * c1 * atn( deg1 / s1 * rad )
            
    for deg2 = 0 to fullcircle step .01

            c2 = cos( deg2 * rad )
            s2 =  sin( deg2 * rad )
   
            x2 = radius * c2 * c2 * c2 * s2 * atn( deg2 / 45 )
            y2 = radius * s2 * s2 * s2 * c2 * atn( deg2 / 45 )
            
            deg3 = ( ( deg2 / deg1 ) + deg2 + deg1 ) / 2
            c3 = cos( deg3 * rad  )
            s3 = sin( deg3 * rad  )
            
            x3 = radius * c3 * c3 / 2 * atn( deg3 / 45 ) * atan2( deg3 , deg2 )
            y3 = radius * s3 * s3 / 2 * atn( deg3 / 45 ) * atan2( deg3 , deg2 )
            
        pset( xctr +x1 +x2 +x3 , yctr +y1 +y2 +y3 ) , 9
        pset( xctr -x1   -x2  -x3 , yctr +y1 +y2 +y3 ) , 9

        pset( xctr +x1 +x2 +x3 , yctr -y1 -y2 -y3 ) , 9
        pset( xctr -x1 -x2 -x3  , yctr -y1 -y2 -y3 ) , 9
           
    next
   
next

Sleep
end

albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0124.bas

Code: Select all


'===========================================================================

dim as single c1 , c2 , c3
dim as single s1 , s2 , s3
dim as single x1 , x2 , x3
dim as single y1 , y2 , y3
dim as single deg1 , deg2 , deg3
dim as single rad

dim as integer xctr , yctr , radius , divisions , fullcircle
dim as integer xres , yres

screeninfo xres , yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2

'radius = (xres*yres)/((xres+yres)*4)
radius = 300

divisions = 22.5

rad = atn( 1 ) / divisions

fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle step 22.5
    
            c1 = cos( deg1 * rad )
            s1 = sin( deg1 * rad )
   
            x1 = radius * c1 * c1
            y1 = radius * s1 * s1
            
    for deg2 = 0 to fullcircle step .1

            c2 = cos( deg2 * rad )
            s2 =  sin( deg2 * rad )
   
            x2 = radius * c2 * c2 * c2 * s2
            y2 = radius * s2 * s2 * s2 * c2
            
        pset( xctr +x1 +x2 , yctr +y1 +y2 ) , 9
        pset( xctr -x1   -x2 , yctr +y1 +y2 ) , 9

        pset( xctr +x1 +x2 , yctr -y1 -y2  ) , 9
        pset( xctr -x1   -x2 , yctr -y1 -y2  ) , 9
           
    next
   
next

Sleep
end

albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0125.bas

Code: Select all


'===========================================================================

dim as single c1 , c2 , c3
dim as single s1 , s2 , s3
dim as single x1 , x2 , x3
dim as single y1 , y2 , y3
dim as single deg1 , deg2 , deg3
dim as single rad

dim as integer xctr , yctr , radius , divisions , fullcircle
dim as integer xres , yres

screeninfo xres , yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2

'radius = (xres*yres)/((xres+yres)*4)
radius = 300

divisions = 22.5

rad = atn( 1 ) / divisions

fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle step 22.5
    
            c1 = cos( deg1 * rad )
            s1 = sin( deg1 * rad )
   
            x1 = radius * c1 * c1
            y1 = radius * s1 * s1
            
    for deg2 = 0 to fullcircle step .01

            c2 = cos( deg2 * rad )
            s2 =  sin( deg2 * rad )
   
            x2 = radius * c2 * c2 * ( log( deg2 * s2 ) / 10 )
            y2 = radius * s2 * s2 * ( log( deg2 * c2 ) / 10 )
            
        pset( xctr +x1 +x2 , yctr +y1 +y2 ) , 9
        pset( xctr -x1   -x2 , yctr +y1 +y2 ) , 9

        pset( xctr +x1 +x2 , yctr -y1 -y2  ) , 9
        pset( xctr -x1   -x2 , yctr -y1 -y2  ) , 9
           
    next
   
next

Sleep
end

albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0126.bas

Code: Select all


'===========================================================================

dim as single c1 , c2 , c3
dim as single s1 , s2 , s3
dim as single x1 , x2 , x3
dim as single y1 , y2 , y3
dim as single deg1 , deg2 , deg3
dim as single rad

dim as integer xctr , yctr , radius , divisions , fullcircle
dim as integer xres , yres

screeninfo xres , yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2

'radius = (xres*yres)/((xres+yres)*4)
radius = 400

divisions = 45

rad = atn( 1 ) / divisions

fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle * 2 step 45
    
            c1 = cos( deg1 * rad )
            s1 = sin( deg1 * rad )
   
            x1=radius * c1 * atn( deg1 / 45 ) * c1 * c1 * s1
            y1=radius * s1 * atn( deg1 / 45 ) * s1 * s1 * c1
            
    for deg2 = 0 to fullcircle step .01

            c2 = cos( deg2 * rad * 8 )
            s2 =  sin( deg2 * rad * 8 )
   
            x2 = radius * c2 * c2 / 4
            y2 = radius * s2 * s2 / 4
            
            x3 = radius * c2 * c2 * s2 * atan2( y1 , x2 ) * atn( c2 * s2 )
            y3 = radius * s2 * s2 * c2 * atan2( x1 , y2 ) * atn( s2 * c2 )
            
        pset( xctr +x1 +x2 +x3 , yctr +y1 +y2 +y3 ) , 9
        pset( xctr -x1   -x2  -x3 , yctr +y1 +y2 +y3 ) , 9

        pset( xctr +x1 +x2 +x3 , yctr -y1 -y2 -y3 ) , 9
        pset( xctr -x1 -x2 -x3  , yctr -y1 -y2 -y3 ) , 9
           
    next
   
next

Sleep
end

albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0127.bas

Code: Select all


'===========================================================================

dim as single c1 , c2 , c3
dim as single s1 , s2 , s3
dim as single x1 , x2 , x3
dim as single y1 , y2 , y3
dim as single deg1 , deg2 , deg3
dim as single rad

dim as integer xctr , yctr , radius , divisions , fullcircle
dim as integer xres , yres

screeninfo xres , yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2

'radius = (xres*yres)/((xres+yres)*4)
radius = 450

divisions = 45

rad = atn( 1 ) / divisions

fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle * 2 step 11.25
    
            c1 = cos( deg1 * rad )
            s1 = sin( deg1 * rad )
   
            x1=radius * c1 * atn( deg1 / 22.5 ) * c1 * c1 * s1 * ( log( deg1 * c1 ) / 10 ) * 1.5
            y1=radius * s1 * atn( deg1 / 22.5 ) * s1 * s1 * c1 * ( log( deg1 * s1 ) / 10 ) * 1.5
            
    for deg2 = 0 to fullcircle step .05

            c2 = cos( deg2 * rad * 8 )
            s2 =  sin( deg2 * rad * 8 )
   
            x2 = radius * c2 * c2 / 4
            y2 = radius * s2 * s2 / 4
            
            x3 = radius * c2 * c2 * s2 * atan2( y1 , x2 ) * atn( c2 * s2 ) * ( log( deg2 * s2 ) / 10 )
            y3 = radius * s2 * s2 * c2 * atan2( x1 , y2 ) * atn( s2 * c2 ) 
            
        pset( xctr +x1 +x2 +x3 , yctr +y1 +y2 +y3 ) , 9
        pset( xctr -x1   -x2  -x3 , yctr +y1 +y2 +y3 ) , 9

        pset( xctr +x1 +x2 +x3 , yctr -y1 -y2 -y3 ) , 9
        pset( xctr -x1 -x2 -x3  , yctr -y1 -y2 -y3 ) , 9
           
    next
   
next

Sleep
end

Here's Abstract_0127-2.bas

Code: Select all


'===========================================================================

dim as single c1 , c2 , c3
dim as single s1 , s2 , s3
dim as single x1 , x2 , x3
dim as single y1 , y2 , y3
dim as single deg1 , deg2 , deg3
dim as single rad

dim as integer xctr , yctr , radius , divisions , fullcircle
dim as integer xres , yres

screeninfo xres , yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2

'radius = (xres*yres)/((xres+yres)*4)
radius = 450

divisions = 45

rad = atn( 1 ) / divisions

fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle * 2 step 11.25
    
            c1 = cos( deg1 * rad )
            s1 = sin( deg1 * rad )
   
            x1=radius * c1 * atn( deg1 / 22.5 ) * c1 * c1 * s1 * ( log( deg1 * c1 ) / 10 ) * 1.5
            y1=radius * s1 * atn( deg1 / 22.5 ) * s1 * s1 * c1 * ( log( deg1 * s1 ) / 10 ) * 1.5
            
    for deg2 = 0 to fullcircle step .05

            c2 = cos( deg1 * deg2 * rad * rad * 10 )
            s2 =  sin( deg1 * deg2 * rad * rad * 10 )
   
            x2 = radius * c2 * c2 / 4
            y2 = radius * s2 * s2 / 4
            
            x3 = radius * c2 * c2 * s2 * atan2( y1 , x2 ) * atn( c2 * s2 ) * ( log( deg2 * s2 ) / 10 )
            y3 = radius * s2 * s2 * c2 * atan2( x1 , y2 ) * atn( s2 * c2 ) 
            
        pset( xctr +x1 +x2 +x3 , yctr +y1 +y2 +y3 ) , 9
        pset( xctr -x1   -x2  -x3 , yctr +y1 +y2 +y3 ) , 9

        pset( xctr +x1 +x2 +x3 , yctr -y1 -y2 -y3 ) , 9
        pset( xctr -x1 -x2 -x3  , yctr -y1 -y2 -y3 ) , 9
           
    next
   
next

Sleep
end

albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0128.bas

Code: Select all


'===========================================================================

dim as single c1 , c2 , c3
dim as single s1 , s2 , s3
dim as single x1 , x2 , x3
dim as single y1 , y2 , y3
dim as single deg1 , deg2 , deg3
dim as single rad

dim as integer xctr , yctr , radius , divisions , fullcircle
dim as integer xres , yres

screeninfo xres , yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2

'radius = (xres*yres)/((xres+yres)*4)
radius = 450

divisions = 45

rad = atn( 1 ) / divisions

fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle * 2 step ( 45 / 6 )
    
            c1 = cos( deg1 * rad * 10 )
            s1 = sin( deg1 * rad * 10 )
   
            x1=radius * c1 * atn( deg1 / 22.5 ) * c1 * c1 * s1 * ( log( deg1 * c1 ) / 10 ) * 1.5
            y1=radius * s1 * atn( deg1 / 22.5 ) * s1 * s1 * c1 * ( log( deg1 * s1 ) / 10 ) * 1.5
            
    for deg2 = 0 to fullcircle step .05

            c2 = cos( deg1 * deg2 * rad * rad * 10 )
            s2 =  sin( deg1 * deg2 * rad * rad * 10 )
   
            x2 = radius * c2 * c2 / 4
            y2 = radius * s2 * s2 / 4
            
            x3 = radius * c2 * c2 * s2 * atan2( y1 , x2 ) * ( atn( deg2 * c2 * s2 ) / 4 ) * ( log( deg1 * deg2 * s2 ) / 10 )
            y3 = radius * s2 * s2 * c2 * atan2( x1 , y2 ) * ( atn( deg2 * s2 * c2 ) / 4 ) * ( log( deg1 * deg2 * s2 ) / 10 )
            
        pset( xctr +x1 +x2 +x3 , yctr +y1 +y2 +y3 ) , 9
        pset( xctr -x1   -x2  -x3 , yctr +y1 +y2 +y3 ) , 9

        pset( xctr +x1 +x2 +x3 , yctr -y1 -y2 -y3 ) , 9
        pset( xctr -x1 -x2 -x3  , yctr -y1 -y2 -y3 ) , 9
           
    next
   
next

Sleep
end

albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0129.bas

Code: Select all


'===========================================================================

dim as single c1 , c2 , c3
dim as single s1 , s2 , s3
dim as single x1 , x2 , x3
dim as single y1 , y2 , y3
dim as single deg1 , deg2 , deg3
dim as single rad

dim as integer xctr , yctr , radius , divisions , fullcircle
dim as integer xres , yres

screeninfo xres , yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2

'radius = (xres*yres)/((xres+yres)*4)
radius = 500

divisions = 45

rad = atn( 1 ) / divisions

fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle * 4 step ( 45 / 4 )
    
            c1 = cos( deg1 * rad )
            s1 = sin( deg1 * rad *10)
   
            x1=radius * c1 * c1 * c1 * s1 / 2
            y1=radius * s1 * s1 * s1 * c1 / 2
            
    for deg2 = 0 to fullcircle / 32 step .001

            c2 = cos( deg1 * deg2 * rad * rad * 10 )
            s2 =  sin( deg1 * deg2 * rad * rad * 10 )
   
            x2 = radius * c2 * c2 / 4
            y2 = radius * s2 * s2 / 4
            
            x3 = radius * c2 * c2 * s2 * atan2( x1 , x2 ) * ( atn( deg1 * deg2 * c2 ) / 4 ) * ( log( deg1 * deg2 * s2 ) / 10 )
            y3 = radius * s2 * s2 * c2 * atan2( y1 , y2 ) * ( atn( deg1 * deg2 * s2 ) / 4 ) * ( log( deg1 * deg2 * s2 ) / 10 )
            
        pset( xctr +x1 +x2 +x3 , yctr +y1 +y2 +y3 ) , 9
        pset( xctr -x1   -x2  -x3 , yctr +y1 +y2 +y3 ) , 9

        pset( xctr +x1 +x2 +x3 , yctr -y1 -y2 -y3 ) , 9
        pset( xctr -x1 -x2 -x3  , yctr -y1 -y2 -y3 ) , 9
           
    next
   
next

Sleep
end

albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0130.bas

Code: Select all


'===========================================================================

dim as single c1 , c2 , c3
dim as single s1 , s2 , s3
dim as single x1 , x2 , x3
dim as single y1 , y2 , y3
dim as single deg1 , deg2 , deg3
dim as single rad

dim as integer xctr , yctr , radius , divisions , fullcircle
dim as integer xres , yres

screeninfo xres , yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2

'radius = (xres*yres)/((xres+yres)*4)
radius = 275

divisions = 45

rad = atn( 1 ) / divisions

fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle step .25
    
            c1 = cos( deg1 * rad )
            s1 = sin( deg1 * rad )
   
            x1=radius * c1 * atan2( deg1 ,  deg2 ) / 1.5
            y1=radius * s1 * atan2( deg1 ,  deg2 ) / 1.5
            
    for deg2 = 0 to fullcircle step 22.5

            c2 = cos( deg2 * rad * 3 )
            s2 =  sin( deg2 * rad * 3 )
   
            x2=radius * c2 * atan2( y1 , x2 ) * atn( c2 * s2 )
            y2=radius * s2 * atan2( x1 , y2 ) * atn( s2 * c2 )
            
        pset( xctr +x1 +x2 , yctr +y1 +y2 ) , 9
        pset( xctr -x1   -x2 , yctr +y1 +y2 ) , 9

        pset( xctr +x1 +x2 , yctr -y1 -y2 ) , 9
        pset( xctr -x1 -x2  , yctr -y1 -y2 ) , 9
           
    next
   
next

Sleep
end

albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0131.bas

Code: Select all


'===========================================================================

dim as single c1,c2
dim as single s1,s2
dim as single x1,x2
dim as single y1,y2
dim as single deg1,deg2
dim as single rad

dim as integer xctr, yctr, radius, divisions, fullcircle, toggle
dim as integer xres,yres

screeninfo xres,yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2 -10

'radius = (xres*yres)/((xres+yres)*4)
radius = 200

divisions = 45

rad = atn( 1 ) / divisions
fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle step .01
    
            c1 = cos( deg1 * rad * 2 )
            s1 = sin( deg1 * rad * 2 )
   
            x1=radius * c1 * atan2( deg1 ,  deg2 ) / 1.5
            y1=radius * s1 * atan2( deg1 ,  deg2 ) / 1.5
            
    for deg2 = 0 to fullcircle step 22.5

            c2 = cos( deg2 * rad * 3 )
            s2 =  sin( deg2 * rad * 3 )
   
            x2=radius * c2 * c2 * c2 * atan2( y1 , x2 ) * atn( c2 * s2 ) * 2
            y2=radius * s2 * s2 * s2 * atan2( x1 , y2 ) * atn( s2 * c2 ) * 2

        pset( xctr +x1 +x2 , yctr +y1 +y2 ) , 9
        pset( xctr -x1 -x2 , yctr +y1 +y2 ) , 9

        pset( xctr +x1 +x2 , yctr -y1 -y2 ) , 9
        pset( xctr -x1 -x2 , yctr -y1 -y2 ) , 9
           
    next
   
next

Sleep
System


albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0132.bas

Code: Select all


'===========================================================================

dim as single c1,c2
dim as single s1,s2
dim as single x1,x2
dim as single y1,y2
dim as single deg1,deg2
dim as single rad

dim as integer xctr, yctr, radius, divisions, fullcircle, toggle
dim as integer xres,yres

screeninfo xres,yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2 -10

'radius = (xres*yres)/((xres+yres)*4)
radius = 200

divisions = 45

rad = atn( 1 ) / divisions
fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle step .01
    
            c1 = cos( deg1 * rad * 2 )
            s1 = sin( deg1 * rad * 2 )
   
            x1=radius * c1 * s1 * s1 * s1 * atan2( deg1 ,  deg2 ) / 1.5
            y1=radius * s1 * atan2( deg1 ,  deg2 ) / 1.5
            
    for deg2 = 0 to fullcircle step 22.5

            c2 = cos( deg2 * rad * 3 )
            s2 =  sin( deg2 * rad * 3 )
   
            x2=radius * c2 * c2 * c2 * atan2( y1 , x2 ) * atn( c2 * s2 ) * 2
            y2=radius * s2 * s2 * s2 * atan2( x1 , y2 ) * atn( s2 * c2 ) * 2

        pset( xctr +x1 +x2 , yctr +y1 +y2 ) , 9
        pset( xctr -x1 -x2 , yctr +y1 +y2 ) , 9

        pset( xctr +x1 +x2 , yctr -y1 -y2 ) , 9
        pset( xctr -x1 -x2 , yctr -y1 -y2 ) , 9
           
    next
   
next

Sleep
System


albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0133.bas

Code: Select all


'===========================================================================

dim as single c1,c2
dim as single s1,s2
dim as single x1,x2
dim as single y1,y2
dim as single deg1,deg2
dim as single rad

dim as integer xctr, yctr, radius, divisions, fullcircle, toggle
dim as integer xres,yres

screeninfo xres,yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2 -10

'radius = (xres*yres)/((xres+yres)*4)
radius = 200

divisions = 45

rad = atn( 1 ) / divisions
fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle step .25
    
            c1 = cos( deg1 * rad * 2 )
            s1 = sin( deg1 * rad * 2 )
   
            x1=radius * c1 * s1 * s1 * s1 * atan2( deg1 ,  deg2 ) / 1.5
            y1=radius * s1 * c1 * c1 * c1 * atan2( deg1 ,  deg2 ) / 3
            
    for deg2 = 0 to fullcircle step 11.25

            c2 = cos( deg2 * rad * 3 )
            s2 =  sin( deg2 * rad * 3 )
   
            x2=radius * c2 * c2 * c2 * atan2( y1 , x2 ) * atn( c2 * s2 ) * 2
            y2=radius * s2 * s2 * s2 * atan2( x1 , y2 ) * atn( s2 * c2 ) * 2

        pset( xctr +x1 +x2 , yctr +y1 +y2 ) , 9
        pset( xctr -x1 -x2 , yctr +y1 +y2 ) , 9

        pset( xctr +x1 +x2 , yctr -y1 -y2 ) , 9
        pset( xctr -x1 -x2 , yctr -y1 -y2 ) , 9
           
    next
   
next

Sleep
System


albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0134.bas

Code: Select all


'===========================================================================

dim as single c1,c2
dim as single s1,s2
dim as single x1,x2
dim as single y1,y2
dim as single deg1,deg2
dim as single rad

dim as integer xctr, yctr, radius, divisions, fullcircle, toggle
dim as integer xres,yres

screeninfo xres,yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2 -10

'radius = (xres*yres)/((xres+yres)*4)
radius = 250

divisions = 45

rad = atn( 1 ) / divisions
fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle step .25
    
            c1 = cos( deg1 * rad * 2 )
            s1 = sin( deg1 * rad * 2 )
   
            x1=radius * c1 * s1 * s1 * s1 * atan2( deg1 ,  deg2 ) / 3
            y1=radius * s1 * c1 * c1 * c1 * atan2( deg1 ,  deg2 ) / 3
            
    for deg2 = 0 to fullcircle step 11.25

            c2 = cos( deg2 * rad * 3 )
            s2 =  sin( deg2 * rad * 3 )
   
            x2=radius * ( c2 * 4 ) * atan2( y1 , x2 ) * atn( c2 * s2 ) / 3
            y2=radius * ( s2 * 4 ) * atan2( x1 , y2 ) * atn( s2 * c2 ) / 3

        pset( xctr +x1 +x2 , yctr +y1 +y2 ) , 9
        pset( xctr -x1 -x2 , yctr +y1 +y2 ) , 9

        pset( xctr +x1 +x2 , yctr -y1 -y2 ) , 9
        pset( xctr -x1 -x2 , yctr -y1 -y2 ) , 9
           
    next
   
next

Sleep
System


albert
Posts: 6000
Joined: Sep 28, 2006 2:41
Location: California, USA

Re: Squares

Post by albert »

Here's Abstract_0135.bas

Code: Select all


'===========================================================================

dim as single c1,c2
dim as single s1,s2
dim as single x1,x2
dim as single y1,y2
dim as single deg1,deg2
dim as single rad

dim as integer xctr, yctr, radius, divisions, fullcircle, toggle
dim as integer xres,yres

screeninfo xres,yres
screenres xres , yres , 8 , 1 , 8

xctr = xres / 2
yctr = yres / 2 -10

'radius = (xres*yres)/((xres+yres)*4)
radius = 600

divisions = 45

rad = atn( 1 ) / divisions
fullcircle = atn( 1 ) * 8 / rad

for deg1 = 0 to fullcircle step .01
    
            c1 = cos( deg1 * rad * 2 )
            s1 = sin( deg1 * rad * 2 )
   
            x1=radius * c1 * s1 * s1 * s1 * atan2( deg1 ,  deg2 ) / 3
            y1=radius * s1 * c1 * c1 * c1 * atan2( deg1 ,  deg2 ) / 3
            
    for deg2 = 0 to fullcircle step 22.5

            c2 = cos( deg2 * rad * 7 )
            s2 =  sin( deg2 * rad * 7 )
   
            x2=radius * ( c2 * 4 ) * atan2( x1 , x2 ) * ( atn( c2 * s2 * deg2 * rad ) / 20 )
            y2=radius * ( s2 * 4 ) * atan2( y1 , y2 ) * ( atn( s2 * c2 * deg2 * rad ) / 20 )

        pset( xctr +x1 +x2 , yctr +y1 +y2 ) , 9
        pset( xctr -x1 -x2 , yctr +y1 +y2 ) , 9

        pset( xctr +x1 +x2 , yctr -y1 -y2 ) , 9
        pset( xctr -x1 -x2 , yctr -y1 -y2 ) , 9
           
    next
   
next

Sleep
System


Locked