Mail Archives: geda-user/2015/09/13/12:19:11
On Sep 13, 2015, at 9:29 AM, DJ Delorie <dj AT delorie DOT com> wrote:
>
> "Angular data is stored in signed integer,"
>
> Not floating point? What about 7 evenly rotated LEDs, or 22.5 degree
> rotations? Given location is nanometers, you should have an equally
> precise unit for other measurements.
There *is* a mathematical way out of this, but it would be very clumsy to implement in a low level language like C. Make all coordinates rational numbers, and restrict angles to those that relate to Pythagorean triples. You can’t exactly represent most angles that way, but you can come arbitrarily close.
If you do this right, you wind up with *exact* knowledge of every point in the x/y Cartesian geometry. Sines and cosines of these angles are rational numbers. No roundoff error. You can choose any unit basis you want (I’d go with meters).
To do this, you’d want to code the geometry part in a language that can handle rational number calculations smoothly, like Guile or Python.
John Doty Noqsi Aerospace, Ltd.
http://www.noqsi.com/
jpd AT noqsi DOT com
- Raw text -