Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another small filled circe sub (not as fast as fcirc)
#12
Hey, neat mod!  I thought it may be a little faster putting the r * r outside of the loop, and it made it FC2 a wee bit faster

EDIT:  (most of the time, FC3 ties FC2 now and then).

- Dav

Code: (Select All)
Sub FC3 (cx, cy, r, clr&)
    Line (cx - r, cy)-(cx + r, cy), clr&, BF
    y = 1
    r2 = r * r
    While y <= r
        x = Int(Sqr(r2 - y * y))
        Line (cx - x, cy + y)-(cx + x, cy + y), clr&, BF
        Line (cx - x, cy - y)-(cx + x, cy - y), clr&, BF
        y = y + 1
    Wend
End Sub

Find my programs here in Dav's QB64 Corner
Reply


Messages In This Thread
RE: Another small filled circe sub (not as fast as fcirc) - by Dav - 08-28-2024, 12:30 PM



Users browsing this thread: 3 Guest(s)