Coverage for navipy/maths/coordinates.py : 93%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Conversion between coordinates systems """
""" Cartesian to spherical coordinates
:param x: position along x-axis :param y: position along y-axis :param z: position along z-axis :returns: elevation,azimuth,radius
inverse transform of : x = radius*cos(elevation) * cos(azimuth) y = radius*cos(elevation) * sin(azimuth) z = radius*sin(elevation)
"""
"""Spherical to cartesian coordinates
:param elevation: elevation :param azimuth: azimuth :param radius: radius :returns: x,y,z
transform : x = radius*cos(elevation) * cos(azimuth) y = radius*cos(elevation) * sin(azimuth) z = radius*sin(elevation) """
"""Now we need the cartesian vector as a spherical vecotr. A vector in cartesian coordinates can be transform as one in the spherical coordinates following the transformation:
A_rho =+A_x.*cos(epsilon).*cos(phi) +A_y.*cos(epsilon).*sin(phi) +A_z.*sin(epsilon) A_epsilon=-A_x.*sin(epsilon).*cos(phi) -A_y.*sin(epsilon).*sin(phi) +A_z.*cos(epsilon) A_phi =-A_x.*sin(phi)+A_y.*cos(phi)
for epsilon in [-pi/2 +pi/2] and phi in [0 2pi] reverse tajectory, needed because the frame x,y,z is expressed in the orientation Yaw=pitch=roll=0""" must have size three") (not isinstance(viewing_direction, np.ndarray)): raise TypeError("angles must be list or np.ndarray") raise TypeError("viewing_direction must be of numerical type") raise Exception("first dimension of viewing\ direction must be of size two")
|