The mirror is the exact arc of a circle of radius R = 1/curvature, built from the implicit circle equation, not a small-angle approximation — a curvature of 0 is numerically indistinguishable from flat at this aperture. For every ray the engine root-finds the true intersection point with that arc (bisection on the ray parameter), computes the local surface tangent by numerical differentiation, derives the outward normal, and reflects the ray with r = d − 2(d·n)n — the vector form of the law of reflection.
law of reflection: θ_incidence = θ_reflection (both measured from the surface normal)
mirror sag: x(h) = −R + sign(R)·√(R² − h²)
reflection: r = d − 2(d·n)n
The focal length and spherical aberration readouts are not looked up from a formula — they are measured directly from the traced rays: each reflected ray's crossing of the mirror's optical axis is computed, the mean crossing gives the measured focal length, and the standard deviation across rays at different heights gives the spread caused by using a spherical (not parabolic) mirror — real spherical aberration, growing with curvature and beam width exactly as it does with a physical mirror.
- Concave (positive curvature) converges rays toward a real focus in front of the mirror.
- Convex (negative curvature) diverges rays; their extensions cross behind the mirror (a virtual focus).
- Tilt rotates the physical mirror against a fixed horizontal beam, which is what actually changes the angle of incidence in a real optics bench — try tilting instead of changing the beam angle and watch the incidence/reflection readout respond identically.