rot.dist | R Documentation |
Calculate the extrinsic or intrinsic distance between two rotations.
rot.dist(x, ...) ## S3 method for class 'SO3' rot.dist(x, R2 = id.SO3, method = "extrinsic", p = 1, ...) ## S3 method for class 'Q4' rot.dist(x, Q2 = id.Q4, method = "extrinsic", p = 1, ...)
x |
n-by-p matrix where each row corresponds to a random rotation in matrix (p=9) or quaternion (p=4) form. |
... |
additional arguments. |
R2, Q2 |
a single, second rotation in the same parametrization as x. |
method |
string indicating "extrinsic" or "intrinsic" method of distance. |
p |
the order of the distance. |
This function will calculate the intrinsic (Riemannian) or extrinsic
(Euclidean) distance between two rotations. R2
and Q2
are set
to the identity rotations by default. For rotations R1 and
R2 both in SO(3), the Euclidean distance between them is
||R1-R2||
where || || is the Frobenius norm. The Riemannian distance is defined as
||Log(R1'R2)||
where Log is the matrix logarithm, and it corresponds to the misorientation angle of R1'R2. See the vignette ‘rotations-intro’ for a comparison of these two distance measures.
The rotational distance between each rotation in x and R2 or Q2.
rs <- rcayley(20, kappa = 10) Rs <- genR(rs, S = id.SO3) dEs <- rot.dist(Rs,id.SO3) dRs <- rot.dist(Rs, id.SO3 , method = "intrinsic") #The intrinsic distance between the true central orientation and each observation #is the same as the absolute value of observations' respective misorientation angles all.equal(dRs, abs(rs)) #TRUE #The extrinsic distance is related to the intrinsic distance all.equal(dEs, 2*sqrt(2)*sin(dRs/2)) #TRUE