SGTmatchT

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

matches two frame to have same ey-vectors ez and ex vectors

Description

Function has been implemented as part of SGtransrelSG in 2016

See Also: SGtransT , SGTalignT , SGtransrelSG , SGTtransT

Example Illustration

 missing image of SGTmatchT(SG,T,TM,az)

Syntax

SGN=SGTmatchT(SG,[T,TM,az])

Input Parameter

SG: Original Position
T: Frame Name of SG or Frame
TM: eye(4) or new coordinate System
az: final turn around ez

Output Parameter

SGN: Final Position of SG

Examples


SGbox; SG=ans; SGTmatchT(SG,'Y-')
SGTmatchT(SG,'Y-',TofPez([0 0 40],[0 -1 0]))




Copyright 2022-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 function, SGTmatchT, is designed to match two frames so that they have the same ey-vectors, ez, and ex vectors. It is part of the SolidGeometry library and was implemented by Tim Lueth in 2022.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the parameters T, TM, and az from the input arguments using the function getfuncparams.
  2. Define a transformation Tal using a rotation matrix for a 180-degree rotation around the y-axis.
  3. If T is a character string, convert it to a matrix using SGTget.
  4. Transform SG using the transformation matrix (TM*TofR(rot(0,0,az))/T) to obtain SGN. This step ensures the most accurate match of the frames in MATLAB.
  5. Calculate the size of the bounding box s for the transformed SGN and the original SG using sofBB.
  6. If no output is requested, plot the transformed SGN and the original SG using SGfigure, SGTplotalpha, and SGplotalpha.

Notes

The function uses several helper functions such as getfuncparams, TofR, rot, SGTget, SGtransT, sofBB, SGfigure, SGTplotalpha, and SGplotalpha to perform its operations. These functions handle parameter retrieval, matrix transformations, plotting, and other tasks.

Algorithm explaination created using ChatGPT on 2025-08-19 07:38. (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