Geometry utilities
point_in_bounding_box(point, bounding_box)
Determine whether an nD point is inside an nD bounding box. Parameters
point : np.ndarray
(n,) array containing nD point coordinates to check.
bounding_box : np.ndarray
(2, n) array containing the min and max of the nD bounding box.
As returned by Layer._extent_data
.
Source code in src/napari_threedee/utils/geometry.py
77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
rotation_matrix_around_vector_3d(angle, vector)
Create the rotation matrix for a specified angle of rotation around a vector.
Parameters
angle : float The signed angle of rotation in radians.
np.ndarray
The vector around which to perform the rotation.
Returns
rotation_matrix : np.ndarray (3, 3) rotation matrix for the specified rotation.
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 |
|
signed_angle_between_vectors(vector_0, vector_1, rotation_axis)
Returns the angle in radians between vectors 'v1' and 'v2'.
Parameters
vector_0 : np.ndarray The vector to start the rotation at. vector_1 : np.ndarray The vector the rotation ends at. rotation_axis : np.ndarray The axis around which the rotation is occuring. Must be orthogonal to vector_0 and vector_1.
Returns
angle : float The signed angle of rotation in radians.
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 |
|