Package gavo :: Package stc :: Module sphermath
[frames] | no frames]

Module sphermath

source code

Spherical geometry and related helper functions.

Classes
  SVConverter
A container for the conversion from spherical coordinates to 6-Vectors.
Functions
 
getRotX(angle)
returns a 3-rotation matrix for rotating angle radians around x.
source code
 
getRotY(angle)
returns a 3-rotation matrix for rotating angle radians around y.
source code
 
getRotZ(angle)
returns a 3-rotation matrix for rotating angle radians around u.
source code
 
getMatrixFromEulerAngles(z1, x, z2)
returns a 3-rotation matrix for the z-x-z Euler angles.
source code
 
getEulerAnglesFromMatrix(matrix)
returns zxz Euler angles from a rotation matrix.
source code
 
getMatrixFromEulerVector(eulerVector)
returns a rotation matrix for an Euler vector.
source code
 
computeTransMatrixFromPole(poleCoo, longZeroCoo, changeHands=False)
returns a transformation matrix to transform from the reference system into a rotated system.
source code
 
vabs(naVec) source code
 
toSpherical(threeVec)
returns spherical coordinates for a cartesian 3-vector.
source code
 
toThreeVec(long, lat)
returns a cartesian 3-vector for longitude and latitude.
source code
Variables
  defaultDistance = 2.06264806247e+12
  __package__ = 'gavo.stc'
Function Details

getMatrixFromEulerAngles(z1, x, z2)

source code 

returns a 3-rotation matrix for the z-x-z Euler angles.

There are some functions to obtain such angles below.

getEulerAnglesFromMatrix(matrix)

source code 

returns zxz Euler angles from a rotation matrix.

This is improvised, and someone should look up a numerically sound way to do this.

getMatrixFromEulerVector(eulerVector)

source code 

returns a rotation matrix for an Euler vector.

An euler vector gives the rotation axis, its magnitude the angle in rad.

This function is a rip-off of SOFA's rv2m.

eulerVector is assumed to be a numpy array.

computeTransMatrixFromPole(poleCoo, longZeroCoo, changeHands=False)

source code 

returns a transformation matrix to transform from the reference system into a rotated system.

The rotated system is defined by its pole, the spherical coordinates at which it has longitude zero and whether or not it is right handed.

All angles are in rad.

toSpherical(threeVec)

source code 

returns spherical coordinates for a cartesian 3-vector.

threeVec needs not be normalized.