rotlib 1.0.0
Loading...
Searching...
No Matches
Utility

Functions

void align (const int n, const double *v, const int m, const double *old, const double *new, double *valigned)
 Rotates vectors such that a set of mutually orthogonal unit vectors aligns with another set of mutually orthogoanl unit vectors.
bool mat_is_rotmat (const double *mat)
 Checks whether a 2D array is a rotation matrix.

Detailed Description

Function Documentation

◆ align()

void align ( const int n,
const double * v,
const int m,
const double * old,
const double * new,
double * valigned )

Rotates vectors such that a set of mutually orthogonal unit vectors aligns with another set of mutually orthogoanl unit vectors.

The vectors v are rotated using a rotation matrix that, when applied to the unit vectors old, aligns them in the direction of the unit vectors new.

Parameters
[in]nNumber of rows of v.
[in]vA n x 3 array whose rows are the vectors to align.
[in]mNumber of rows of old, same as the number of rows of new.
[in]oldA m x 3 array, where m is at most 3. The rows of old form a set of mutually orthogonal unit vectors.
[in]newA m x 3 array, where m is at most 3. The rows of new form a set of mutually orthogonal unit vectors. The angles between the vectors must be the same as those of old.
[out]valignedA n x 3 array whose rows are the aligned vectors.

◆ mat_is_rotmat()

bool mat_is_rotmat ( const double * mat)

Checks whether a 2D array is a rotation matrix.

Parameters
[in]matA 3x3 array.
Returns
true if mat is a rotation matrix, false otherwise.