gfxCircle
gfxCircle is a basic geometric drawing primitive found in many graphics libraries, particularly those used for embedded systems and hobbyist electronics. It provides a straightforward method for rendering a circle on a pixel‑based display using integer math, which is efficient for devices with limited processing power and no floating‑point unit. The function typically accepts a center point (x, y), a radius, and a color value. In many implementations it also allows an optional thickness parameter to draw either a filled circle or the outline of a circle.
The most common algorithm used by gfxCircle is the midpoint circle algorithm. This method calculates points
The gfxCircle function first appeared in the Adafruit GFX library for Arduino in 2009 and has since
Typical usage looks like this:
color = 0xFFFF // white in 16‑bit RGB565
gfxCircle(x, y, radius, color)
When a filled circle is desired, many libraries offer a separate filledCircle function, or the circle function