Atan2 and Hypot function speedup...

Eychaner, Glenn C. gceych at juliet.caltech.edu
Sun Dec 23 07:12:49 AEST 1990


In article <1990Dec22.200215.20898 at nntp-server.caltech.edu>, gceych at juliet.caltech.edu (Eychaner, Glenn C.) writes...
>Ok, so maybe I'm not so smart.  After receiving many suggestions, including
>METAFONT by Knuth and some new gadget called the cordic (course and direction
>computer) functions which simulateously compute ATAN2 and HYPOT, I realized
>that I was taking the result of ATAN2 and shoving it back through TAN! (duh...)
>8-}   SO now all I need to do is speed up the HYPOT section.....any suggestions
>(I need the Pythagorean HYPOT of two ints (or unsigned chars) returned as int.
>Precision isn't that important (the nearest int is more than enough).)
>Duh....... 

Double duh...I take the ATAN followed by the TAN in order to add in an
offset angle between the two steps....so send in those ideas!
i.e. tan (atan2 (a, b) + x)

Glenn Eychaner    | Eychaner at SunCub.Caltech.edu | "We demand rigidly defined
40386 N Shore Ln  | gceych at iago.caltech.edu     |  areas of doubt and
Big Bear City, CA | Big Bear Solar Observatory  |  uncertainty!"
            92314 | !*** G O   N I N E R S ***! |                 -D. Adams



More information about the Comp.lang.c mailing list