Skip to main content
U.S. flag

An official website of the United States government

This site is currently in beta, and your feedback is helping shape its ongoing development.

Computation of 3-d matrices of maximal trace over rotations

Published by National Institute of Standards and Technology | National Institute of Standards and Technology | Metadata Last Checked: August 02, 2025 | Last Modified: 2019-06-01 00:00:00
The programs here compute 3x3 matrices of maximal trace over rotation matrices from input matrices. A dxd matrix M is of maximal trace over rotation matrices if given any dxd rotation matrix U, the trace of UM does not exceed that of M. Given a dxd matrix M, the problem of finding among all dxd rotation matrices U one such that UM is of maximal trace over rotation matrices is intricately related to the so-called constrained orthogonal Procrustes problem which is the least-squares problem that calls for a rotation matrix that optimally aligns two corresponding sets of points in d-dimensional Euclidean space. It is well known that computing an optimal U can be achieved with a method based on the computation of the singular value decomposition (SVD) of M. The package consists of a Fortran program, a Matlab program, a Matlab mex file of the Fortran program, a compilation of the mex file, and a sample data file of 3x3 matrices. If a 3x3 matrix M is symmetric, without the SVD, the Fortran program computes an optimal 3x3 rotation matrix U for M with an approach based on a trigonometric identity. Otherwise, if M is not symmetric, part of the approach can still be used to compute U with the SVD. However, the option exists in the program to execute a procedure based on the Cayley transform and Newton's method that for each input matrix M computes a rotation matrix U such that UM is symmetric. If the procedure is successful (Newton's method didn't fail) a rotation matrix R (without the SVD) is computed as described above such that RUM is of maximal trace over rotation matrices. If Newton's method fails, then using the SVD, the program computes a rotation matrix R such that RM is of maximal trace over rotation matrices. Note the following: (a) The option exists in the Fortran code to do everything using the SVD only. (b) If using the Cayley-Newton procedure in the Fortran code, an integer variable named ITEX is set to the maximum number of allowed iterations per input matrix of Newton's method. (c) The Matlab program can be used for the same purposes. The option also exists in the Matlab code to do everything using the Matlab version of the SVD method only. Otherwise the Matlab mex file of the Fortran program is used by the Matlab code. This has the effect of executing the Fortran code as described above from the Matlab code.

Find Related Datasets

Click any tag below to search for similar datasets

data.gov

An official website of the GSA's Technology Transformation Services

Looking for U.S. government information and services?
Visit USA.gov