Tsvd

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Kinematics and Frames
Introduced first in SolidGeometry 5.5, Creation date: 2025-08-09, Last change: 2025-09-15

Correction fnct for an HT matrix for orthogonalizing a matrix after multiplication

Description

using ChatGPT

See Also: TofVL

Example Illustration

 missing image of Tsvd(T)

Syntax

TS=Tsvd(T)

Input Parameter

T: Original HT Matrix

Output Parameter

TS: svd corrected T matrix with corrected R=[ex ey yz]

Examples


TofR([pi,pi,pi]), To=ans; Tsvd(To), Tsvd(round(To,13))




Copyright 2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This algorithm is designed to orthogonalize a given homogeneous transformation (HT) matrix using Singular Value Decomposition (SVD). It ensures that the rotation part of the matrix is orthogonal and right-handed.

Input Parameters

Output Results

Algorithm Steps

  1. Extract the rotation block from the input matrix T. This is the top-left 3x3 submatrix, denoted as R.
  2. Perform Singular Value Decomposition (SVD) on the rotation matrix R. This decomposes R into three matrices: U, S, and V, where R = U * S * V'.
  3. Reconstruct an orthogonal matrix R_ortho by multiplying U and the transpose of V (i.e., R_ortho = U * V').
  4. Ensure the reconstructed matrix R_ortho is right-handed. This is done by checking the determinant of R_ortho. If the determinant is negative, adjust the last column of U by negating it, and then recompute R_ortho.
  5. Replace the original rotation block in T with the orthogonalized matrix R_ortho.
  6. Assign the modified matrix to TS, which is the output of the function.

Additional Information

If the function is called without output arguments, it calculates the error as the sum of absolute differences between the original and corrected matrices. It then prints this error and the original vector for debugging purposes.

Algorithm explaination created using ChatGPT on 2025-08-19 00:07. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21