# | Line 54 | Line 54 | tcos(double x) /* approximate cosine */ | |
---|---|---|
54 | ||
55 | /* Fast arctangent approximation due to Rajan et al. 2006 */ | |
56 | double | |
57 | < | aatan2(double y, double x) |
57 | > | atan2a(double y, double x) |
58 | { | |
59 | double ratio, aratio, val; | |
60 | ||
# | Line 64 | Line 64 | aatan2(double y, double x) | |
64 | aratio = (ratio = y/x) >= 0 ? ratio : -ratio; | |
65 | ||
66 | if (aratio > 1.01) | |
67 | < | return PI/2. - aatan2(x, y); |
67 | > | return PI/2. - atan2a(x, y); |
68 | ||
69 | val = PI/4.*ratio - ratio*(aratio - 1.)*(0.2447 + 0.0663*aratio); | |
70 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |