Mail Archives: geda-user/2015/09/13/21:29:41
On Sep 13, 2015, at 5:19 PM, DJ Delorie <dj AT delorie DOT com> wrote:
>
>> It is if (x, y, h) is a Pythagorean triple. By
>> definition. https://en.wikipedia.org/wiki/Pythagorean_triple
>
> Well, OK, but (1) they're rare and/or hard to find for a given angle,
I don’t think it’s that hard for a decent approximation, although:
Mathematician son: “Can you enumerate the Pythagorean triples?”
Me: "Sure, it’s trivial, you just…"
Mathematician son: “No, I mean is there an *efficient* algorithm?”
Me: "I have no idea.”
Mathematician son: “You just flunked your Google interview."
But maybe the quickest is to search for “table of pythagorean triples” using Google. ;-)
> and (2) you still have to divide by H to normalize a rotation, which
> gives you a floating point imprecision.
>
No, you stay in the rational domain. You *never* use floating point in this system except for export. Rational numbers are not floating point, but pairs of integers like 245/998. You use a programming language with a rational type (built-in to Guile, a module in Python). Rational numbers are closed under addition, subtraction, multiplication, and division, so computation is error-free. Rational vectors are closed under rotation by angles represented by Pythagorean triples, and those angles are closed under composition of rotation (or what you might want to think of as addition of angles). This system is thus not subject to imprecision internally. Only exported data will be imprecise, since that generally involves a grid and/or floating point.
John Doty Noqsi Aerospace, Ltd.
http://www.noqsi.com/
jpd AT noqsi DOT com
- Raw text -