ssapy_toolkit.vectors
Vector utilities and small helpers for geometry and plotting.
Functions
|
Return the angle between two vectors in radians. |
|
|
|
Extend a vector by a given distance along its direction. |
|
Calculate the angle between vectors a, b, and c, where b is the vertex. |
|
|
|
|
|
Normalise an array of vectors along the last axis. |
Returns two vectors that are perpendicular to v and each other. |
|
|
|
|
Rotate a set of 3D points about a 3D axis by an angle theta in radians. |
|
|
|
Find the rotation matrix that aligns vec1 to vec2 :param vec1: A 3d "source" vector :param vec2: A 3d "destination" vector :return mat: A transform matrix (3x3) which when applied to vec1, aligns it with vec2. |
|
Returns the unit vector of the vector. |
- ssapy_toolkit.vectors.angle_between_vectors(vector1, vector2)[source]
Return the angle between two vectors in radians.
- ssapy_toolkit.vectors.extend_vector(vector: ndarray, distance: float) ndarray[source]
Extend a vector by a given distance along its direction.
- ssapy_toolkit.vectors.getAngle(a: ndarray, b: ndarray, c: ndarray) ndarray[source]
Calculate the angle between vectors a, b, and c, where b is the vertex.
Parameters: a, b, c (np.ndarray): Input vectors.
Returns: np.ndarray: The angle between the vectors in radians.
Author: Travis Yeager (yeager7@llnl.gov)
- ssapy_toolkit.vectors.perpendicular_vectors(v)[source]
Returns two vectors that are perpendicular to v and each other.
- ssapy_toolkit.vectors.rotate_points_3d(points, axis=array([0, 0, 1]), theta=-1.5707963267948966)[source]
Rotate a set of 3D points about a 3D axis by an angle theta in radians.
- Args:
points (np.ndarray): The set of 3D points to rotate, as an Nx3 array. axis (np.ndarray): The 3D axis to rotate about, as a length-3 array. Default is the z-axis. theta (float): The angle to rotate by, in radians. Default is pi/2.
- Returns:
np.ndarray: The rotated set of 3D points, as an Nx3 array.