_Title "Spinner" 'b+ 2021-06-18
Screen _NewImage(500, 500, 32)
Const rad = _Pi / 180

DECLARE Sub arc (xCenter, yCenter, arcRadius, dAStart, dAMeasure)

Color , &H000088
While 1
    Cls
    b = b + 5
    For r = 20 To 200 Step 20 ' tsh73 suggested fix for inner most
        a = b * r / 20
        For i = r - 15 To r
            Color _RGB32(255 - r, 255 - .5 * r, 255)
            arc (250, 250, i, a, 180)
        Next
    Next
    _Display
Wend

Sub arc (xCenter, yCenter, arcRadius, dAStart, dAMeasure)
    'notes:
    'you may want to adjust size and color for line drawing
    'using angle measures in degrees to match Just Basic ways with pie and piefilled
    'this sub assumes drawing in a CW direction if dAMeasure positive

    'for Just Basic angle 0 degrees is due East and angle increases clockwise towards South

    'dAStart is degrees to start Angle, due East is 0 degrees

    'dAMeasure is degrees added (Clockwise) to dAstart for end of arc

    rAngleStart = rad * dAStart
    rAngleEnd = rad * dAMeasure + rAngleStart
    Stepper = rad / (.1 * arcRadius) 'fixed
    lastX = xCenter + arcRadius * Cos(rAngleStart)
    lastY = yCenter + arcRadius * Sin(rAngleStart)
    PSet (lastX, lastY)
    For rAngle = rAngleStart + Stepper To rAngleEnd Step Stepper
        nextX = xCenter + arcRadius * Cos(rAngle)
        nextY = yCenter + arcRadius * Sin(rAngle)
        Line -(nextX, nextY) 'int speeds things up
    Next
End Sub