cart_to_cyl
- ssapy.utils.cart_to_cyl(x, y, z)[source][source]
Convert Cartesian coordinates to cylindrical coordinates.
This function converts Cartesian coordinates (x, y, z) to cylindrical coordinates: radial distance (r), azimuthal angle (theta), and height (z).
Parameters:
x (float or array-like): The x-coordinate(s). y (float or array-like): The y-coordinate(s). z (float or array-like): The z-coordinate(s).
Returns:
- tuple:
r (float or array-like): Radial distance from the origin in the x-y plane.
theta (float or array-like): Azimuthal angle in radians (angle in the x-y plane from the positive x-axis).
z (float or array-like): Height along the z-axis (unchanged from input).
Example:
cart_to_cyl(1, 1, 1) -> (1.4142135623730951, 0.7853981633974483, 1)