coordinates.coordinate_systems.CartesianCoordinateSystem2D.get_conversion_transform#
- CartesianCoordinateSystem2D.get_conversion_transform(other: _CoordinateSystemBase) Callable #
Construct a coordinate transformation function that maps native coordinates from this coordinate system to the target coordinate system.
The returned function can be used to convert any valid input (scalars or arrays) in the native coordinate system of self into the native coordinate system of other.
- Parameters:
other (
_CoordinateSystemBase
) – The target coordinate system to transform into.- Returns:
A function that takes native coordinates of self and returns native coordinates of other.
- Return type:
Callable
Example
sph = SphericalCoordinateSystem() cyl = CylindricalCoordinateSystem() transform = sph.get_conversion_transform(cyl) rho, phi, z = transform(1.0, np.pi / 2, 0.0)
Notes
This conversion is performed via Cartesian coordinates: native (self) -> Cartesian -> native (other).