Geometry utilities
napari_threedee.utils.geometry
signed_angle_between_vectors(vector_0, vector_1, rotation_axis: np.ndarray) -> float
Returns the angle in radians between vectors 'v1' and 'v2'.
PARAMETER | DESCRIPTION |
---|---|
vector_0
|
The vector to start the rotation at.
TYPE:
|
vector_1
|
The vector the rotation ends at.
TYPE:
|
rotation_axis
|
The axis around which the rotation is occuring. Must be orthogonal to vector_0 and vector_1.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
angle
|
The signed angle of rotation in radians.
TYPE:
|
Source code in src/napari_threedee/utils/geometry.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
rotation_matrix_around_vector_3d(angle: float, vector: np.ndarray) -> np.ndarray
Create the rotation matrix for a specified angle of rotation around a vector.
PARAMETER | DESCRIPTION |
---|---|
angle
|
The signed angle of rotation in radians.
TYPE:
|
vector
|
The vector around which to perform the rotation.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
rotation_matrix
|
(3, 3) rotation matrix for the specified rotation.
TYPE:
|
Source code in src/napari_threedee/utils/geometry.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
|
point_in_bounding_box(point: np.ndarray, bounding_box: np.ndarray) -> bool
Determine whether an nD point is inside an nD bounding box.
PARAMETER | DESCRIPTION |
---|---|
point
|
(n,) array containing nD point coordinates to check.
TYPE:
|
bounding_box
|
(2, n) array containing the min and max of the nD bounding box.
As returned by
TYPE:
|
Source code in src/napari_threedee/utils/geometry.py
77 78 79 80 81 82 83 84 85 86 87 88 89 |
|