## Squares

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

### Re: Squares

Here's Abstract_0076.bas

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 200divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0077.bas

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 300divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0078.bas

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 375divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0079.bas

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 375divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0080.bas

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 200divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0081.bas

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 500divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0082.bas

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 500divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0083.bas

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 500divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0084.bas

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 500divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0085.bas ( Twelve Stars )

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 2000divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0086.bas ( Six Stars )

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 1000divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0087.bas

Code: Select all

`dim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 2400divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

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

Code: Select all

`' From galactic-chicken.basdim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 120divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1toggle = 0do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

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

Code: Select all

`' From galactic-chicken.basdim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 75divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1toggle = 0do           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       nextloop until inkey <>""`
albert
Posts: 5230
Joined: Sep 28, 2006 2:41
Location: California, USA

### Re: Squares

Here's Abstract_0090.bas

Code: Select all

`' From galactic-chicken.basdim as single c1,c2dim as single s1,s2dim as single x1,x2dim as single y1,y2dim as single deg1,deg2dim as single rad1dim as single rad2dim as integer xctr, yctr, radius, divisions, fullcircle, toggledim as integer xres,yres'screen 19screeninfo xres,yresscreenres xres,yres,8,1,8xctr = xres/2yctr = yres/2'radius = (xres*yres)/((xres+yres)*4)radius = 100divisions = 45rad1 = atn(1) / divisionsrad2 = atn(1) / (divisions/2)fullcircle = atn(1)*8 / rad1do           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       nextloop until inkey <>""`