Skip to contents

Transformations

These functions allow you to make tranformations to your coordinate system, such as translations, rotations or conversion to polar coordinates.

transform_to_egocentric()
Transform coordinates to an egocentric reference frame
translate_coords()
Translate coordinates in Cartesian space
rotate_coords()
Rotate coordinates in Cartesian space
map_to_cartesian()
Map to Cartesian coordinates
map_to_polar()
Map from Cartesian to polar coordinates
map_to_cylindrical()
Map from Cartesian to cylindrical coordinates
map_to_spherical()
Map from Cartesian to spherical coordinates
cartesian_to_rho()
Radius (rho) from Cartesian coordinates
cartesian_to_phi()
Azimuth (phi) from Cartesian coordinates
cartesian_to_theta()
Inclination (theta) from Cartesian coordinates
polar_to_x()
Cartesian x-coordinate from polar coordinates
polar_to_y()
Cartesian y-coordinate from polar coordinates
spherical_to_z()
Cartesian z-coordinate from spherical coordinates

Rotations

Unit quaternions (Hamilton, scalar first) for 3D orientation: algebra, conversion to and from axis-angle, matrices and Euler angles, and interpolation, averaging and angular velocity.

quat_multiply() quat_conjugate() quat_normalise() quat_rotate() quat_distance()
Quaternion algebra
quat_from_axis_angle() quat_to_axis_angle() quat_from_matrix() quat_to_matrix()
Quaternions from and to other rotation representations
quat_from_vectors() experimental
Quaternions from two body axes given as vectors
quat_from_euler() quat_to_euler()
Quaternions from and to Euler angles
quat_slerp() quat_mean() quat_continuous() quat_angular_velocity() experimental
Interpolate, average and differentiate rotations
transform_euler_to_quaternion() transform_quaternion_to_euler() experimental
Convert orientation between Euler angles and quaternions