neurots.morphmath.rotation¶
Definition of basic rotation functionality.
Functions
|
Return the angle between v1, v2. |
|
Rotate the input vector vec by a selected angle around a specific axis. |
|
Return a normalized vector rotated around the selected axis by an angle. |
|
Find the rotation matrix that aligns vec1 to vec2. |
|
Return the spherical coordinates of a vector: phi, theta. |
|
Return a normalized vector from the spherical angles: phi, theta. |
- neurots.morphmath.rotation.angle3D(v1, v2)¶
Return the angle between v1, v2.
- neurots.morphmath.rotation.rotate_vector(vec, axis, angle)¶
Rotate the input vector vec by a selected angle around a specific axis.
- neurots.morphmath.rotation.rotation_around_axis(axis, angle)¶
Return a normalized vector rotated around the selected axis by an angle.
- neurots.morphmath.rotation.rotation_matrix_from_vectors(vec1, vec2)¶
Find the rotation matrix that aligns vec1 to vec2.
Picked from morph_tool.transform Picked from: https://stackoverflow.com/a/59204638/3868743
- Parameters:
vec1 – A 3d “source” vector
vec2 – A 3d “destination” vector
- Returns:
A transform matrix (3x3) which when applied to vec1, aligns it with vec2.
- neurots.morphmath.rotation.spherical_from_vector(vect)¶
Return the spherical coordinates of a vector: phi, theta.
- neurots.morphmath.rotation.vector_from_spherical(phi, theta)¶
Return a normalized vector from the spherical angles: phi, theta.