Squares

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

Re: Squares

Postby albert » Nov 08, 2019 20:19

Here's Abstract_0076.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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
screeninfo xres,yres
screenres xres,yres,8,1,8

xctr = xres/2
yctr = yres/2

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

divisions = 45

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle * 8 step 45
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 ^ s1 * cos( log( deg1 * rad1 * c1 / s1 ) ) * atn( deg1 * c1 ) / 2 * log( deg1 * c1 ) / 2
            y1=radius * s1 ^ c1 * cos( log( deg1 * rad1 * s1 / c1 ) ) * atn( deg1 * s1 ) / 2 * log( deg1 * s1 ) / 4
           
        for deg2 = 0 to fullcircle / 2 step .1
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
           
            x2=radius * c2 ^ 4 / 2 * (log( deg2 * c2 ) / 20 ) * atn( c2 ) * deg2 / 100 * deg1 / 200
            y2=radius * s2 ^ 2 * (log( deg2 * c2 ) / 20 ) * atn( s2 ) * deg2 / 100 * deg1 / 600
             
            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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 20:26

Here's Abstract_0077.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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
screeninfo xres,yres
screenres xres,yres,8,1,8

xctr = xres/2
yctr = yres/2

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

divisions = 45

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle * 2 step 1
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 ^ s1 * cos( log( deg1 * rad1 * c1 / s1 ) ) * atn( deg1 * c1 ) / 2 * log( deg1 * c1 ) / 2
            y1=radius * s1 ^ c1 * cos( log( deg1 * rad1 * s1 / c1 ) ) * atn( deg1 * s1 ) / 2 * log( deg1 * s1 ) / 4
           
        for deg2 = 0 to fullcircle step .1
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
           
            x2=radius * c2 ^ 4 / 2 * (log( deg2 * c2 ) / 20 ) * deg2 / 100 * atn( c2 )
            y2=radius * s2 ^ 4 / 2  * (log( deg2 * c2 ) / 20 ) * deg2 / 100 * atn( s2 )
             
            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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 20:31

Here's Abstract_0078.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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
screeninfo xres,yres
screenres xres,yres,8,1,8

xctr = xres/2
yctr = yres/2

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

divisions = 45

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle step 1
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 ^ s1 * cos( log( deg1 * rad1 * c1 * s1 ) )
            y1=radius * s1 ^ c1 * cos( log( deg1 * rad1 * s1 * c1 ) )
           
        for deg2 = 0 to fullcircle / 2 step .1
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
           
            x2=radius * c2 ^ 4 / 2 * (log( deg2 * c2 ) / 20 ) * deg2 / 100 * atn( c2 * s2 )
            y2=radius * s2 ^ 4 / 2 * (log( deg2 * c2 ) / 20 ) * deg2 / 100 * 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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 20:35

Here's Abstract_0079.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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
screeninfo xres,yres
screenres xres,yres,8,1,8

xctr = xres/2
yctr = yres/2

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

divisions = 45

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle * 32 step 22.5
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 ^ s1 * cos( log( deg1 * rad1 * c1 * s1 ) )
            y1=radius * s1 ^ c1 * cos( log( deg1 * rad1 * s1 * c1 ) )
           
        for deg2 = 0 to fullcircle / 2 step .1
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
           
            x2=radius * c2 ^ 4 / 2 * (log( deg2 * c2 ) / 20 ) * deg2 / 100 * atn( c2 * s2 )
            y2=radius * s2 ^ 4 / 2 * (log( deg2 * c2 ) / 20 ) * deg2 / 100 * 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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 20:50

Here's Abstract_0080.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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
screeninfo xres,yres
screenres xres,yres,8,1,8

xctr = xres/2
yctr = yres/2

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

divisions = 45

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle * 8 step 4
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 ^ s1 * cos( log( deg1 * rad1 * c1 / s1 ) ) * 2 * c1
            y1=radius * s1 ^ c1 * sin( log( deg1 * rad1 * s1 / c1 ) ) * 2 * s1
           
        for deg2 = 0 to fullcircle * 8 step 2
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
           
            x2=radius * c2 ^ 4 / 2 * (log( deg2 * c2 ) / 20 ) * atan2( deg2 , 100 )
            y2=radius * s2 ^ 4 / 2 * (log( deg2 * c2 ) / 20 ) * atan2( deg2 , 100 )
             
            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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 21:08

Here's Abstract_0081.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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
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

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle * 8 step 20
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 ^ s1 * cos( log( deg1 * rad1 * c1 / s1 ) ) * log(c1^2)
            y1=radius * s1 ^ c1 * sin( log( deg1 * rad1 * s1 / c1 ) ) *  log(s1^2)
           
        for deg2 = 0 to fullcircle * 8 step 1
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
           
            x2=radius * c2 ^ 4 / 2 * (log( deg2 * c2 ) / 20 ) * atan2( deg1 * c2 , deg2 )
            y2=radius * s2 ^ 4 / 2 * (log( deg2 * s2 ) / 20 ) * atan2( deg1 * s2 , deg2 )
             
            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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 21:16

Here's Abstract_0082.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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
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

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle * 8 step 2
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 ^ s1 * cos( log( deg1 * rad1 * c1 / s1 ) ) * log(c1^2)
            y1=radius * s1 ^ c1 * sin( log( deg1 * rad1 * s1 / c1 ) ) *  log(s1^2)
           
        for deg2 = 0 to fullcircle * 8 step 1
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
           
            x2=radius * c2 ^ 4 / 2 * (log( deg2 * c2 ) / 20 ) * atan2( deg1 * c2 , deg2 / s2 ) * atn( deg2 * c1 ) / 8 * tan( c2 )
            y2=radius * s2 ^ 4 / 2 * (log( deg2 * s2 ) / 20 ) * atan2( deg1 * s2 , deg2 / c2 ) * atn( deg2 * s1 ) / 8 * tan( s2 )
             
            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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 21:41

Here's Abstract_0083.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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
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

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle * 4 step 10
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 ^ s1 * cos( log( deg1 * rad1 * c1 / s1 ) ) * atn(c1^2)
            y1=radius * s1 ^ c1 * sin( log( deg1 * rad1 * s1 / c1 ) ) *  atn(s1^2)
           
        for deg2 = 0 to fullcircle * 8 step .5
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
           
            x2=radius * c2 ^ 4 / 2 * (log( deg2 * c2 ) / 20 )
            y2=radius * s2 ^ 4 / 2 * (log( deg2 * s2 ) / 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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 21:55

Here's Abstract_0084.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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
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

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle * 16 step 45
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 * ( c1 ^ s1 ) * cos( log( deg1 * rad1 * c1 / s1 ) / deg1 ) * atn(c1^2) / 10 * log( deg1 )
            y1=radius * s1 * ( s1 ^ c1 ) * cos( log( deg1 * rad1 * s1 / c1 ) / deg1 ) *  atn(s1^2) / 10 * log( deg1 )
           
        for deg2 = 0 to fullcircle * 8 step 1
           
            c2=cos( deg2 * rad2 * 45 )
            s2=sin( deg2 * rad2 * 45 )
           
            x2=radius * c2 ^ 4  / 4 * ( log( deg2 ) / 20 ) * atan2( c2 , s2*deg2)
            y2=radius * s2 ^ 4  / 4 * ( log( deg2 ) / 20 ) * atan2( c2 , s2*deg2)
             
            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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 22:31

Here's Abstract_0085.bas ( Twelve Stars )

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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
screeninfo xres,yres
screenres xres,yres,8,1,8

xctr = xres/2
yctr = yres/2

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

divisions = 45

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle * 4 step 10
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 * ( c1 ^ s1 ) * atn(c1^2) * cos( log( deg1 ) ) / 2.5 * (tan( deg1 ) / 2 ) / 20
            y1=radius * s1 * ( s1 ^ c1 ) * atn(s1^2) * cos( log( deg1 ) ) / 2.5 * (tan( deg1 ) / 2 ) / 20
           
        for deg2 = 0 to fullcircle * 2 step 2
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
           
            x2=radius * c2 ^ 4  / 4 * ( log( deg2 ) / 20 ) * atan2( deg1 * c2 , c1 * deg2) / 4 * cos( deg2 / 360 * c2 )
            y2=radius * s2 ^ 4  / 4 * ( log( deg2 ) / 20 ) * atan2( deg1 * s2 , s1 * deg2) / 4 * cos( deg2 / 360 * s2 )
             
            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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 23:25

Here's Abstract_0086.bas ( Six Stars )

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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
screeninfo xres,yres
screenres xres,yres,8,1,8

xctr = xres/2
yctr = yres/2

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

divisions = 45

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle / 8 step 45
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 * ( c1 ^ s1 ) * atn(c1^2) / 1.5 * 2 / 3
            y1=radius * s1 * ( s1 ^ c1 ) * atn(s1^2) / 1.5 * 2 / 3
           
        for deg2 = 0 to fullcircle * 32 step 5
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
           
            x2=radius * c2 ^ 4  / 8 * ( log( deg2 ) / 40 ) * atn( deg2 / 22.5 * c2 ) * 2
            y2=radius * s2 ^ 4  / 8 * ( log( deg2 ) / 40 ) * atn( deg2 / 22.5 * s2 ) * 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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 23:33

Here's Abstract_0087.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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
screeninfo xres,yres
screenres xres,yres,8,1,8

xctr = xres/2
yctr = yres/2

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

divisions = 45

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle / 8 step 45
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 * ( c1 ^ s1 ) / 8
            y1=radius * s1 * ( s1 ^ c1 ) / 8
           
        for deg2 = 0 to fullcircle * 32 step .1
           
            c2=cos( deg2 * rad2 * 22.5 )
            s2=sin( deg2 * rad2 * 22.5 )
           
            x2=radius * c2 ^ 4  / 8 * ( log( deg2 ) / 40 ) * atn( deg2 / 22.5 * c2 ) * 2 * cos( c2 / s1 ) * 4
            y2=radius * s2 ^ 4  / 8 * ( log( deg2 ) / 40 ) * atn( deg2 / 22.5 * s2 ) * 2 * cos( c2 / s1 )
             
            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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 08, 2019 23:56

Here's Abstract_0088.bas ( used Abstract_0003.bas )

Code: Select all

' From galactic-chicken.bas

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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
screeninfo xres,yres
screenres xres,yres,8,1,8

xctr = xres/2
yctr = yres/2

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

divisions = 45

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

toggle = 0
do
   
        for deg1 = 0 to fullcircle * 2 step 45
   
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 * atn( deg1 / 45 ) * 1.25
            y1=radius * s1 * atn( deg1 / 45 ) * 1.25
           
        for deg2 = 0 to fullcircle step .1
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
       
            x2=radius * s2 * ( log( deg2 / 360 ) / 4 ) * 1.25 / 1.1
            y2=radius * c2 * ( log( deg2 / 360 ) / 4 ) * 1.25 / 1.5
             
            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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 09, 2019 0:26

Here's Abstract_0089.bas ( way cool!! )

Code: Select all

' From galactic-chicken.bas

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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
screeninfo xres,yres
screenres xres,yres,8,1,8

xctr = xres/2
yctr = yres/2

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

divisions = 45

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

toggle = 0
do
   
        for deg1 = 0 to fullcircle * 8 step 22.5
           
            c1=cos( deg1 * rad1 )
            s1=sin( deg1 * rad1 )
   
            x1=radius * c1 * atn( deg1 / 22.5 ) * 2.25
            y1=radius * s1 * atn( deg1 / 22.5 ) * 2.25
           
        for deg2 = 0 to fullcircle * 8 step 10
           
            c2=cos( deg2 * rad2 )
            s2=sin( deg2 * rad2 )
       
            x2=radius * s2 * ( log( deg2 / 360 ) / 4 ) * 2.25 / 1.1
            y2=radius * c2 * ( log( deg2 / 360 ) / 4 ) * 2.25 / 1.5
             
            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

loop until inkey <>""

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

Re: Squares

Postby albert » Nov 09, 2019 0:49

Here's Abstract_0090.bas

Code: Select all

' From galactic-chicken.bas

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 rad1
dim as single rad2


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

dim as integer xres,yres
'screen 19
screeninfo xres,yres
screenres xres,yres,8,1,8

xctr = xres/2
yctr = yres/2

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

divisions = 45

rad1 = atn(1) / divisions
rad2 = atn(1) / (divisions/2)
fullcircle = atn(1)*8 / rad1

do
   
        for deg1 = 0 to fullcircle * 16 step 22.5
           
            c1=cos( deg1 * rad1 * 45 )
            s1=sin( deg1 * rad1 * 45 )
   
            x1=radius * c1 * atn( deg1 / 22.5 ) * 2.25 / 1.111 / 1.111
            y1=radius * s1 * atn( deg1 / 22.5 ) * 2.25 / 1.111 / 1.111
           
        for deg2 = 0 to fullcircle * 8 step 11.25
           
            c2=cos( deg2 * rad2 * 45 )
            s2=sin( deg2 * rad2 * 45 )
       
            x2=radius * s2 * ( log( deg2 / 360 ) / 4 ) * 2.25 / 1.111 / 1.111
            y2=radius * c2 * ( log( deg2 / 360 ) / 4 ) * 2.25 / 1.111 / 1.111
             
            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

loop until inkey <>""


Return to “General”

Who is online

Users browsing this forum: No registered users and 2 guests