Module vectors
source code
Collection of functions for vector operations.
|
|
numpy float64 array
|
|
float
|
vector_angle(vector1,
vector2,
normal)
Calculate the directional angle between two N-dimensional vectors. |
source code
|
|
|
__package__ = ' lib.geometry '
|
Imports:
acos,
cos,
pi,
sin,
array,
cross,
dot,
float64,
norm,
uniform
Generate a random rotation axis.
Uniform point sampling on a unit sphere is used to generate a random
axis orientation.
- Parameters:
vector (numpy 3D, rank-1 array) - The 3D rotation axis.
|
Generate the unit vector connecting point 1 to point 2.
- Parameters:
point1 (list of float or numpy array) - The first point.
point2 (list of float or numpy array) - The second point.
- Returns: numpy float64 array
- The unit vector.
|
Calculate the directional angle between two N-dimensional vectors.
- Parameters:
vector1 (numpy rank-1 array) - The first vector.
vector2 (numpy rank-1 array) - The second vector.
normal (numpy rank-1 array) - The vector defining the plane, to determine the sign.
- Returns: float
- The angle between -pi and pi.
|