by Hugh » Sun Feb 02, 2025 11:03 pm
Hi steelpillow. I asked o3-high-mini about this and it replied:
“There’s a long‐standing anecdote among ZX Spectrum programmers that when you try to rotate a tesseract (or any wireframe object) in Spectrum BASIC, if one of the vertices happens to lie exactly at the origin, that point “refuses” to move—resulting in the whole figure gradually becoming distorted. Many have attributed this behavior to a flaw in one of the Spectrum’s built‑in trigonometric routines in its ROM.
The most common explanation is that the ROM’s sine (and/or cosine) routine—written in assembly for speed and using fixed‑point arithmetic—had limited precision and didn’t handle certain edge‑cases very well. In particular, when an input of 0 (or values very near 0) was fed in, rounding errors or an internal normalization quirk could cause the routine to return an exact 0 (or an incorrect value) instead of the mathematically expected result. When this happens during a rotation calculation, the vertex at the origin effectively “gets stuck” while the other vertices are transformed normally.
Thus, while mathematically a rotation about the origin should leave a point at (0,0,0,0) unchanged, in a properly constructed 4D rotation all vertices are generally offset from the origin so that every point moves (relative to some central pivot). In steelpillow’s case the presence of a vertex exactly at the origin meant that this ROM bug in the trigonometric routine (most likely the SIN routine) became apparent, leading to the observed distortion.
In short, yes—it appears that what steelpillow experienced was a well‑known quirk (or “bug”) in the ZX Spectrum’s ROM trigonometric routines, most likely due to how they handled an input of 0 (or near‑0 values) in the sine (or cosine) function.”