geolime.utilities.trigonometry¶
Data:
|
The central part of internal API. |
Functions:
|
Compute the angle between two vectors using the dot product |
|
Convert an angle from geographic to arithmetic |
|
Matrix or vector norm. |
|
(Adapted from Apach Commons normalizeAngle, MathUtils sources) Normalize an angle in a 2pi; wide interval around a center value. |
|
Rotation againt the X axis |
|
Rotation againt the Y axis |
|
Example of a convention |
|
Rotation againt the Z axis |
|
Example of a convention (RGeoStats) |
-
geolime.utilities.trigonometry.
angle_between_vectors
(v1: numpy.ndarray, v2: numpy.ndarray)¶ Compute the angle between two vectors using the dot product
- Parameters
v1 (np.ndarray) – first cartesian vector
v2 (np.ndarray) – second cartesian vector
- Returns
angle between two vectors in radians
- Return type
float
-
geolime.utilities.trigonometry.
arithmetic
(angle: float)¶ Convert an angle from geographic to arithmetic
- Parameters
angle (float) – angle to be converted in radians
- Returns
arithmetic angle in radians
- Return type
float
-
geolime.utilities.trigonometry.
normalize
(a: float, center: float)¶ (Adapted from Apach Commons normalizeAngle, MathUtils sources) Normalize an angle in a 2pi; wide interval around a center value. This method has three main uses: * normalize an angle between 0 and 2pi: a = normalize(a, np.pi) * normalize an angle between -pi and +pi: a = normalize(a, 0.0) * compute the angle between two defining angular positions: angle = normalize(end, start) - start
Note that due to numerical accuracy and since pi; cannot be represented exactly, the result interval is closed, it cannot be half-closed as would be more satisfactory in a purely mathematical view.
- Parameters
a (float) – angle to be normalized (in radians)
center (float) – center value in radians
- Returns
normalized angle in radians
- Return type
float
-
geolime.utilities.trigonometry.
rot_x
(gamma: float, deg: bool = True, clockwise: bool = True)¶ Rotation againt the X axis
- Parameters
gamma (float) – Rotation angle
deg (bool) – True if theta is in degrees
clockwise (bool) – if True: clockwise, if False: counter-clockwise rotation
- Returns
Rotation matrix
- Return type
np.ndarray
-
geolime.utilities.trigonometry.
rot_y
(beta: float, deg: bool = True, clockwise: bool = True)¶ Rotation againt the Y axis
- Parameters
beta (float) – Rotation angle
deg (bool) – True if theta is in degrees
clockwise (bool) – if True: clockwise, if False: counter-clockwise rotation
- Returns
Rotation matrix
- Return type
np.ndarray
-
geolime.utilities.trigonometry.
rot_yxz
(angles: List[float], deg: bool = True, clockwise: bool = True)¶ Example of a convention
- Parameters
angles (List[float]) – Description of parameter angles.
deg (float) – Description of parameter deg.
clockwise (bool) – Clockwise if set to True, counter-clockwise otherwise
- Returns
A rotation matrix
- Return type
np.ndarray
-
geolime.utilities.trigonometry.
rot_z
(alpha: float, deg: bool = True, clockwise: bool = True)¶ Rotation againt the Z axis
- Parameters
alpha (float) – Rotation angle
deg (bool) – True if theta is in degrees
clockwise (bool) – if True: clockwise, if False: counter-clockwise rotation
- Returns
Rotation matrix
- Return type
np.ndarray
-
geolime.utilities.trigonometry.
rot_zyx
(angles: List[float], deg: bool = False, clockwise: bool = True)¶ Example of a convention (RGeoStats)
- Parameters
angles (List[float]) – Description of parameter angles.
deg (float) – Description of parameter deg.
clockwise (bool) – Clockwise if set to True, counter-clockwise otherwise
- Returns
A rotation matrix
- Return type
np.ndarray