Package pygeodesy :: Module cartesianBase
[frames] | no frames]

Module cartesianBase

(INTERNAL) Private CartesianBase class for elliposiodal, spherical and N-/vectorial Cartesians and public functions rtp2xyz, rtp2xyz_, xyz2rtp and xyz2rtp_.

After (C) Chris Veness 2011-2024 published under the same MIT Licence**, see https://www.Movable-Type.co.UK/scripts/latlong.html, https://www.Movable-Type.co.UK/scripts/latlong-vectors.html and https://www.Movable-Type.co.UK/scripts/geodesy/docs/latlon-ellipsoidal.js.html.


Version: 24.10.12

Classes
  RadiusThetaPhi3Tuple
3-Tuple (r, theta, phi) with radial distance r in meter, inclination theta (with respect to the positive z-axis) and azimuthal angle phi in Degrees or Radians representing a spherical, polar position.
Functions
 
rtp2xyz(r_rtp, theta=0, phi=0, **name_Cartesian_and_kwds)
Convert spherical, polar (r, theta, phi) to cartesian (x, y, z) coordinates.
 
rtp2xyz_(r_rtp, theta=0, phi=0, **name_Cartesian_and_kwds)
Convert spherical, polar (r, theta, phi) to cartesian (x, y, z) coordinates.
 
xyz2rtp(x_xyz, y=0, z=0, **name)
Convert cartesian (x, y, z) to spherical, polar (r, theta, phi) coordinates.
 
xyz2rtp_(x_xyz, y=0, z=0, **name)
Convert cartesian (x, y, z) to spherical, polar (r, theta, phi) coordinates.
Variables
  __all__ = _ALL_LAZY.cartesianBase
Function Details

rtp2xyz (r_rtp, theta=0, phi=0, **name_Cartesian_and_kwds)

 

Convert spherical, polar (r, theta, phi) to cartesian (x, y, z) coordinates.

Arguments:
  • theta - Inclination theta (degrees with respect to the positive z-axis), required if r_rtp is scalar, ignored otherwise.
  • phi - Azimuthal angle phi (degrees), like theta.

See Also: Function rtp2xyz_ for further details.

rtp2xyz_ (r_rtp, theta=0, phi=0, **name_Cartesian_and_kwds)

 

Convert spherical, polar (r, theta, phi) to cartesian (x, y, z) coordinates.

Arguments:
  • r_rtp - Radial distance (scalar, conventially meter) or a previous RadiusThetaPhi3Tuple instance.
  • theta - Inclination theta (radians with respect to the positive z-axis), required if r_rtp is scalar, ignored otherwise.
  • phi - Azimuthal angle phi (radians), like theta.
  • name_Cartesian_and_kwds - Optional name=NN (str), a Cartesian=None class to return the coordinates and optional, additional Cartesian keyword arguments.
Returns:
A Cartesian(x, y, z) instance or if no Cartesian keyword argument is given a Vector3Tuple(x, y, z), with x, y and z in the same units as radius r, meter conventionally.
Raises:
  • TypeError - Invalid r_rtp, theta, phi or name_Cartesian_and_kwds item.

See Also: Physics convention (ISO 80000-2:2019), class RadiusThetaPhi3Tuple and functions rtp2xyz and xyz2rtp.

xyz2rtp (x_xyz, y=0, z=0, **name)

 

Convert cartesian (x, y, z) to spherical, polar (r, theta, phi) coordinates.

Returns:
RadiusThetaPhi3Tuple(r, theta, phi) with theta and phi, both in Degrees.

See Also: Function xyz2rtp_ for further details.

xyz2rtp_ (x_xyz, y=0, z=0, **name)

 

Convert cartesian (x, y, z) to spherical, polar (r, theta, phi) coordinates.

Arguments:
  • x_xyz - X component (scalar) or a cartesian (Cartesian, Ecef9Tuple, Nvector, Vector3d, Vector3Tuple, Vector4Tuple or a tuple or list of 3+ scalar items) if no y_z specified.
  • y - Y component (scalar), required if x_xyz is scalar, ignored otherwise.
  • z - Z component (scalar), like y.
  • name - Optional name=NN (str).
Returns:
RadiusThetaPhi3Tuple(r, theta, phi) with radial distance r (meter, same units as x, y and z), inclination theta (with respect to the positive z-axis) and azimuthal angle phi, both in Radians.

See Also: Physics convention (ISO 80000-2:2019), class RadiusThetaPhi3Tuple and function xyz2rtp.