Function coord_transforms::d2::cartesian2polar
source · Expand description
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( x^2 + y^2 )
- theta = arctan(y / x)