Learn R Programming

orientlib (version 0.10.5)

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)

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.

Arguments

x

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

Author

Duncan Murdoch

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
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