The atan2 function is used mostly to convert from rectangular (x,y) to polar (r, θ) coordinates that must satisfy x = r cos(θ) and y = r sin (θ). In general, conversions to polar coordinates should be computed thus
- atan2 ( ±0, -0) returns ± π.
- atan2 ( ±0, +0 ) returns ±0.
- atan2 ( ±0, x ) returns ±π for x < 0.
- atan2 ( ±0 , x ) returns ±0 for x > 0.
- atan2 ( ±0 ) returns -π/2 for y > 0.
- atan2 ( ±y, -∞ ) returns ±π for finite y > 0.
- atan2 ( ±y, +∞ ) returns ±0 for finite y > 0.
- atan2 ( ±∞, +x ) returns ±π/2 for finite x.
- atan2 ( ±∞, -∞ ) returns ±3π/4.
- atan2 ( ±∞, +∞ ) returns ±π/4.
No comments:
Post a Comment