From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,583275b6950bf4e6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-20 06:45:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Logic Errors and Ada (Was: A big hairy thread on Ada, Quality, and Drivers) Date: 20 May 2003 09:36:04 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <9fa75d42.0304230424.10612b1a@posting.google.com> <9fa75d42.0305130543.60381450@posting.google.com> <254c16a.0305140549.3a87281b@posting.google.com> <9fa75d42.0305141747.5680c577@posting.google.com> <1053027582.984315@master.nyc.kbcfp.com> <3ec4b5c5$1@news.wineasy.se> <254c16a.0305160930.40bb42f9@posting.google.com> <9fa75d42.0305181502.53703035@posting.google.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1053438701 2948 128.183.235.92 (20 May 2003 13:51:41 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 20 May 2003 13:51:41 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:37562 Date: 2003-05-20T13:51:41+00:00 List-Id: Preben Randhol writes: > Dr Chaos wrote: > > On 19 May 2003 20:42:42 +0100, Simon Wright wrote: > >> type Position is record > >> Lat : Latitude; > >> Long : Longitude; > >> end record; > >> > >> and inspect the low-level support subprograms. > > > > What is the right way to do spherical geometry with separate > > latitude and longitude types? > > > > The problem mathematically that I see is that SO(3) > > transformations will yield arithmetic combinations of these, > > which would require lots of I would guess conversions to > > some kind of default float. > > Maybe so (I don't know), but would it not be a bigger chance of catch > lunatic calculations when you try to do a conversion back to Latitude > and Longitude? I mean if the values are outside the bounds of the > Latitude and Longitude types? > > > On the other hand, if Latitude and Longitude were variables > > whose values would be displayed to humans or perhaps stored > > in some database, then the separate typing may work. > > Huh? I think he agrees with my policy; do all internal calculations in a data structure that supports full rotations (SO(3) is group theory notation for the rotation group); that means orthornormal matrices or unit quaternions. Only convert to lat/long for user input/output. That avoids singularities and unit confusion in the core code. -- -- Stephe