pub fn polar2cartesian(r: f32, th: f32) -> (f32, f32)
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);