THE MIDPOINT CIRCLE a circle from integers and 8-fold symmetry — x²+y² is the only test
Bresenham’s idea, bent into a circle. The midpoint circle algorithm draws one octant with an integer decision based on the sign of x²+y² − r² — inside or outside — then reflects that octant eight ways to complete the circle. No trigonometry, no square roots. The decision is the circle equation itself; the eight-fold symmetry means you compute an eighth and mirror the rest. For radius 5 the lattice point (3,4) sits exactly on the circle (9+16=25), and so does its reflection (4,3) — the Pythagorean triple the algorithm rides.
THE TECHNIQUE decision = sign(x²+y²−r²); one octant, mirrored 8×
The demo checks the r=5 circle: (3,4), (4,3), (5,0) lie exactly on it; (3,3) does not: live demo
HISTORY & CREDIT midpoint circle · Bresenham circle
“A circle needs sine and cosine.” — the midpoint algorithm needs only x²+y² and reflection; no trig at all. cited
the decision · sign(x²+y²−r²) — step in or stay, integer only. the symmetry · compute one octant, mirror it 8 ways — (x,y) gives 8 points. the triple · for r=5, (3,4) is exact (3²+4²=5²) — the Pythagorean point.
A ring drawn from the circle equation and a mirror — one octant, reflected into eight. resource
RECOMMEND FOR I-13 the exact circle points, on the compiler
On the canonical compiler, (3,4), (4,3), (5,0) satisfy x²+y²=25 exactly, while (3,3) does not:
$ i13 run cg_midpointcircle.i13 # x^2+y^2 == r^2
RUN OK · 109 step(s) · peak stack 4 · call depth 1
on_34 = 1 on_43 = 1 on_50 = 1 -- exactly on the r=5 circle
off_33 = 0 -- 18 != 25
circle = 1
Recommend as a NULL — resource + a symmetry. The midpoint circle uses the integer decision x²+y²−r² (a computed value, B39) and 8-fold reflection to save work (resource, B40). The reflection is a group symmetry (dart 499’s kin), not a new axis. NULL — a circle from arithmetic and a mirror.