Circle Generator

Generate perfect pixel circles and ovals for your Minecraft builds. Download as PNG or copy the block count.

Circle Preview

Blocks: 0 Size: 0 x 0

Minecraft Commands

The Midpoint Circle Algorithm

This tool uses the Midpoint Circle Algorithm (also known as Bresenham's Circle Algorithm), a highly efficient method for determining which pixels should be filled to approximate a circle on a discrete grid.

The algorithm works by exploiting the eight-way symmetry of circles. Only one octant needs to be calculated; the other seven are derived through reflection. This makes it extremely fast compared to naive trigonometric approaches.

Mathematical Foundation

A circle is defined by the equation:

(x - h)² + (y - k)² = r²

Where (h, k) is the center and r is the radius. The midpoint algorithm tracks an error term to decide whether the next pixel should be placed at (x+1, y) or (x+1, y-1).

Decision Parameter

The algorithm uses a decision parameter d initialized as:

d = 1 - r

At each step:

  • If d < 0: The midpoint is inside the circle, so we move to (x+1, y) and update d += 2x + 3
  • If d ≥ 0: The midpoint is outside, so we move to (x+1, y-1) and update d += 2(x - y) + 5

Oval Generation

For ovals (ellipses), the algorithm extends to handle different radii on the X and Y axes. The ellipse equation:

(x/a)² + (y/b)² = 1

Where a is the semi-major axis (horizontal radius) and b is the semi-minor axis (vertical radius).

Thickness Calculation

Thick circles are generated by computing both an outer and inner circle, then filling only the pixels that fall between them. For a circle with thickness t:

  • Outer radius = r
  • Inner radius = r - t
  • A pixel is filled if: inner_radius² ≤ distance² ≤ outer_radius²

References

The Midpoint Circle Algorithm was derived from Bresenham's line algorithm and published by Jack Bresenham at IBM in 1962. For more information, see: