neurots.morphmath.rotation

Definition of basic rotation functionality.

Functions

angle3D(v1, v2)

Return the angle between v1, v2.

rotate_vector(vec, axis, angle)

Rotate the input vector vec by a selected angle around a specific axis.

rotation_around_axis(axis, angle)

Return a normalized vector rotated around the selected axis by an angle.

rotation_matrix_from_vectors(vec1, vec2)

Find the rotation matrix that aligns vec1 to vec2.

spherical_from_vector(vect)

Return the spherical coordinates of a vector: phi, theta.

vector_from_spherical(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.