www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/09/13/17:49:13

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
Date: Sun, 13 Sep 2015 17:48:59 -0400
Message-Id: <201509132148.t8DLmxI6003481@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: geda-user AT delorie DOT com
In-reply-to: <AB671235-711B-4ECD-9015-515A5BFC6955@noqsi.com> (message from
John Doty on Sun, 13 Sep 2015 15:00:26 -0600)
Subject: Re: [geda-user] Apollon
References: <20150913140631 DOT 1da1b78d AT jive DOT levalinux DOT org> <201509131529 DOT t8DFTUVS022118 AT envy DOT delorie DOT com> <B0EDB76E-F0DE-4A05-97FC-A405489ACA5A AT noqsi DOT com> <201509131824 DOT t8DIOCBc028428 AT envy DOT delorie DOT com> <B03281A2-123E-4F54-B3AA-CB8CCB09F1B1 AT noqsi DOT com> <201509132031 DOT t8DKVH0P000824 AT envy DOT delorie DOT com> <AB671235-711B-4ECD-9015-515A5BFC6955 AT noqsi DOT com>
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Yes. But that's more of a problem with floating point.

"60" isn't floating point, though.  Angles are convenient numbers to
use, it's the result of using those angles that gets messy.  Using a
vector for angles means that pretty much *every* angle becomes a
floating point problem, because the actual angle will always be some
epsilon away from what the user intended.

> What you really want in the Cartesian representation is sines and
> cosines, but sin( 60 degrees ) is irrational, not representable in
> floating point.

That's what I said.  Most rational angles cannot be represented as a
rational vector.

Also, most rational vectors do not have a rational magnitude.

> Perfect undo is easy. Angles are represented by pairs of integers,
> with no roundoff error within that closed system. You only
> accumulate error with respect to your external expectations going
> forward. But how many layers of rotation do you typically have in a
> practical design? Maybe three, four? Within the system, all
> calculations are exact.

I bring it up only because it's been an issue before, before the
nanometers switch.  Rotating by X then -X did not result in the
original.

I'm also now thinking "select all elements rotated by 60 degrees" is
going to be an imprecise operation (not that we had it *at all*
before now).

We also have to be careful that "rotate left 60" is the same as
"rotate right -60".  Hmmm... the vector needs to be normalized (a unit
vector), so an angle like "123/456" would have to include a scale,
which would either be itself irrational (square roots) or introduce
yet another epsilon.  Which means undoing a rotation might not be
exact.

Perhaps the only way to avoid problems with sin/cos is to avoid using
them at all - you always store the relationships between parts and
subparts as a translation and a rotation, so the rotation (in degrees
or whatever) can be retained as-is, rather than the result of using
that rotation.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019