Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another small filled circe sub (not as fast as fcirc)
#35
Yes, I recall how Bill didn't think using SQR could possibly work, until I did exactly that. Mostly thanks to _INTEGER64, it worked.

That reminds me....
Code: (Select All)
Sub FC3 (cx, cy, r, clr&)
    Line (cx - r, cy)-(cx + r, cy), clr&, BF
    y = 1
    r2 = r * r ' Dav mod
    While y <= r
        y2 = y * y
        If y2 < r2 Then
            x = Int(Sqr(r2 - y2))
            Line (cx - x, cy + y)-(cx + x, cy + y), clr&, BF
            Line (cx - x, cy - y)-(cx + x, cy - y), clr&, BF
        End If
        y = y + 1
    Wend
End Sub

Could be modified to...
Code: (Select All)
Sub FC3 (cx, cy, r, clr&)
    Dim x as Integer
    Line (cx - r, cy)-(cx + r, cy), clr&, BF
    r2 = r * r ' Dav mod
    Do Until y > r
        y = y + 1
        y2 = y * y
        If y2 < r2 Then
            x = Sqr(r2 - y2)
            Line (cx - x, cy + y)-(cx + x, cy + y), clr&, BF
            Line (cx - x, cy - y)-(cx + x, cy - y), clr&, BF
        End If
    Loop
End Sub

Pete
Shoot first and shoot people who ask questions, later.
Reply


Messages In This Thread
RE: Another small filled circe sub (not as fast as fcirc) - by Pete - 08-30-2024, 04:21 AM



Users browsing this thread: 28 Guest(s)