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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d923bb34ea827f56 X-Google-Attributes: gid103376,public From: Alan Brain Subject: Re: Ada / Boeing 777 Date: 1996/03/22 Message-ID: <4ivbt1$q41@fred.netinfo.com.au>#1/1 X-Deja-AN: 143800879 references: <199603181348.IAA08669@bb.iu.net> <4iv1id$dlm@gaia.ns.utk.edu> content-type: text/plain; charset=us-ascii organization: Netinfo Pty Ltd - Canberra Australia mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 1.2N (Windows; I; 16bit) Date: 1996-03-22T00:00:00+00:00 List-Id: mbk@caffeine.engr.utk.edu (Matt Kennel) wrote: >The representation (aka implementation) of angle is wrong. > >It should be a complex number of unit magnitude. Rotations in any >direction can be implemented as complex multiplication without any >discontinuities, wrap around errors or problems at 0 or 180 or 360 >degrees. > >This is an easy 2-d representation of the rotation group. 3-d is >trickier: either Euler angles or quaternions. > >Don't just hack on the problem: transcend it. > >See, sometimes physicists *can* be useful. ;-) Us Engineers come across this problem often. IMHO the best, in fact the ONLY solution is to have something like RADIANS_TYPE, a real, and then use subtypes and I/O converters appropriately. So if you're communicating with a piece of kit that likes to give you BAMS, you just multiply by the constant FROM_BAMS and convert from fixed point to real accordingly. Similarly, for some applications, a human-readable readout of 0-359 is good; for others, 1-360. Mils, Revs, Radians and Degrees are all useful at one time or another: but keep your arithmetic operations in a common format, else that way lies madness.