Function gdnative_core::globalscope::polar2cartesian
source · [−]Expand description
Coordinate system conversion: polar -> cartesian
Polar coordinates: distance r from the origin + angle th (radians).
Cartesian coordinate system: x and y axis.
Example:
use gdnative::globalscope::*;
let (x, y) = polar2cartesian(13.0, -0.394791119699);
assert_eq!(x, 12.0);
assert_eq!(y, -5.0);