www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2015/09/13/12:19:11

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-TCPREMOTEIP: 207.224.51.38
X-Authenticated-UID: jpd AT noqsi DOT com
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
Subject: Re: [geda-user] Apollon
From: John Doty <jpd AT noqsi DOT com>
In-Reply-To: <201509131529.t8DFTUVS022118@envy.delorie.com>
Date: Sun, 13 Sep 2015 10:18:56 -0600
Message-Id: <B0EDB76E-F0DE-4A05-97FC-A405489ACA5A@noqsi.com>
References: <20150913140631 DOT 1da1b78d AT jive DOT levalinux DOT org> <201509131529 DOT t8DFTUVS022118 AT envy DOT delorie DOT com>
To: geda-user AT delorie DOT com
X-Mailer: Apple Mail (2.1878.6)
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id t8DGJ4uA013952
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

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 -


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