We should show everything, number of sides and multiplier. Have to go to 720 degrees because some drawings aren't completing.
Code: (Select All)
_Title "Basic Polygon with Multiplier Mod" 'b+ 2022-07-13
' a circle is 360 degree
' a polyon of n side has central angles 360 / n > think of a pie the central angle are the angle of slices in center
Screen _NewImage(500, 500, 32)
_ScreenMove 350, 100
xC = _Width / 2 ' middle of screen
yC = _Height / 2 ' ditto
r = 200 ' radius = less than half screen height
For n = 5 To 32
For m = 1 To n - 1
Cls
Print "Sides ="; n; " Multiplier ="; m
Circle (xC, yC), r ' here is our pie, Apple or Pepperroni :-))
For angle = 0 To 720 Step 360 / n ' step the size of pie angles
' let xC, yC be the coordinates at the center of the pie circle
' let r be the radius of the pie
' then the n outside points are
x = xC + r * Cos(m * _D2R(angle) - _Pi / 2) ' x coordinate of outter edge point
y = yC + r * Sin(m * _D2R(angle) - _Pi / 2) ' y coordinate of outter edge point
If angle = 0 Then PSet (x, y) Else Line -(x, y) ' outter edge edge
Line (xC, yC)-(x, y) ' slice from center of pie
Next
Print "press any to see next ..."
Sleep
Next
Next
Print "Demo is done."
b = b + ...