Function coord_transforms::d2::cartesian2polar
[−]
[src]
pub fn cartesian2polar(cart_vec: &Vector2<f64>) -> Vector2<f64>
Converts 2-d cartesian coordinates to 2-d polar coordinates
Arguments
cart_vec
- Vector2 reference to the cartesian vector (x, y)
Return Value
nalgebra::Vector2<f64>
- rho, theta (in radians)
Formula
- r = sqrt( x2 + y2 )
- theta = arctan(y / x)