Draw that Circle
#5
Excellent. I had been looking at it too long and totally forgot calculating r^2 only has to happen once.  Thank you.

Code: (Select All)
Sub rcircle (cx As Long, cy As Long, r As Long, klr As _Unsigned Long)
    rsqrd = r * r
    y = 0
    While y <= r
        x = Sqr(rsqrd - y * y)
        Line (cx - x, cy + y)-(cx + x, cy + y), klr
        Line (cx - x, cy - y)-(cx + x, cy - y), klr
        y = y + 1
    Wend
End Sub
Reply


Messages In This Thread
Draw that Circle - by James D Jarvis - 08-26-2022, 04:00 PM
RE: Draw that Circle - by bplus - 08-26-2022, 05:34 PM
RE: Draw that Circle - by bplus - 08-26-2022, 05:39 PM
RE: Draw that Circle - by SMcNeill - 08-26-2022, 05:49 PM
RE: Draw that Circle - by James D Jarvis - 08-26-2022, 05:56 PM
RE: Draw that Circle - by James D Jarvis - 08-26-2022, 05:49 PM
RE: Draw that Circle - by bplus - 08-26-2022, 05:54 PM
RE: Draw that Circle - by bplus - 08-26-2022, 05:59 PM
RE: Draw that Circle - by SMcNeill - 08-26-2022, 06:05 PM
RE: Draw that Circle - by SMcNeill - 08-26-2022, 05:59 PM
RE: Draw that Circle - by bplus - 08-26-2022, 06:18 PM
RE: Draw that Circle - by James D Jarvis - 08-26-2022, 06:33 PM
RE: Draw that Circle - by mnrvovrfc - 08-26-2022, 09:44 PM
RE: Draw that Circle - by justsomeguy - 08-28-2022, 01:26 AM
RE: Draw that Circle - by SMcNeill - 08-28-2022, 03:32 AM
RE: Draw that Circle - by justsomeguy - 08-28-2022, 04:13 AM
RE: Draw that Circle - by SMcNeill - 08-28-2022, 05:55 AM
RE: Draw that Circle - by justsomeguy - 08-28-2022, 06:29 AM



Users browsing this thread: 4 Guest(s)