Learn R Programming

rotations (version 0.1)

dist: Compute the rotational distance

Description

Calculate the Euclidean or Riemannian distance between two rotations.

Usage

dist(x, ...)

## S3 method for class 'SO3': dist(x, R2 = id.SO3, method = "projected", p = 1, ...)

## S3 method for class 'Q4': dist(x, Q2 = id.Q4, method = "projected", p = 1, ...)

Arguments

x
$n\times p$ matrix where each row corresponds to a random rotation in matrix (p=9) or quaternion (p=4) form.
R2,Q2
the second rotation in the same parameterization as x.
method
string indicating "projected" or "intrinsic" method of distance.
p
the order of the distance.
...
additional arguments.

Value

  • The rotational distance between each rotation in x and R2 or Q2.

Details

This function will calculate the intrinsic (Riemannian) or projected (Euclidean) distance between two rotations. R2 and Q2 are set to the identity rotations by default. For rotations $R_1$ and $R_2$ both in $SO(3)$, the Euclidean distance between them is $$||R_1-R_2||_F$$ where $||\cdot||_F$ is the Frobenius norm. The Riemannian distance is defined as $$||Log(R_1^\top R_2)||_F$$ where $Log$ is the matrix logarithm, and it corresponds to the misorientation angle of $R_1^\top R_2$. To compute the distance matrix use stats::dist().