orientlib (version 0.10.3)

nearest: Find nearest SO(3) or orthogonal matrix.

Description

Converts arbitrary 3 x 3 matrices into the nearest SO(3) or orthogonal matrix.

Usage

nearest.SO3(x)
nearest.orthog(x)

Arguments

x

3 x 3 matrices stored in a 3 x 3 x n array)

Value

nearest.SO3 produces an orientation-class object holding the closest orientations.

nearest.orthog produces a 3 x 3 x n array of orthogonal matrices.

Details

Uses Stephens' (1979) algorithm to find the nearest (in entry-wise Euclidean sense) SO(3) or orthogonal matrix to a given matrix.

References

Stephens (1979). Vector correlation. Biometrika 66, 41-48.

See Also

orientation-class

Examples

Run this code
# NOT RUN {
x <- matrix(rnorm(9), 3,3)
nearest.orthog(x)
nearest.SO3(x)
x <- -x
nearest.orthog(x)
nearest.SO3(x)
# }

Run the code above in your browser using DataLab