Email List: Xaustin-review-lX
[All Lists]

Re: Defect in XSH atan2

To: "yyyyyyyyyyyyyyy@xxxxxxxxxxxxx" <yyyyyyyyyyyyyyy@xxxxxxxxxxxxx>, "yyyyyyyy@xxxxxxx" <yyyyyyyy@xxxxxxx>
Subject: Re: Defect in XSH atan2
From: "Fred J. Tydeman" <yyyyyyy@xxxxxxxxx>
Date: Tue, 22 Jul 03 17:06:11 -0700
Priority: Normal
On Tue, 22 Jul 2003 10:47:53 +0100 (BST), yyyyyyyy@xxxxxxx wrote:

>polar_t 
>cartesian_to_polar(const cartesian2d_t v /* vector in cartesian */
>                  )
>{
>  polar_t polar_v;  /* v in polar */
>
>  polar_v.rho   = sqrt (v.x*v.x + v.y*v.y);

   polar_v.rho   = hypot( v.x, v.y );  /* Better than sqrt for special cases */

>  polar_v.theta = atan2 (v.y, v.x);
>
>  return polar_v;
>}

---
Fred J. Tydeman        Tydeman Consulting
yyyyyyy@xxxxxxxxx      Programming, testing, numerics
+1 (775) 287-5904      Vice-chair of J11 (ANSI "C")
Sample C99+FPCE tests: ftp://jump.net/pub/tybor/
Savers sleep well, investors eat well, spenders work forever.

<Prev in Thread] Current Thread [Next in Thread>