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
- SG: The original position of the object or frame.
- T: The frame name of SG or the frame itself. It can be a string or a matrix.
- TM: A transformation matrix, typically a 4x4 identity matrix or a new coordinate system.
- az: The final rotation around the ez-axis, given in radians.
Output
- SGN: The final position of SG after transformation.
Algorithm Steps
- Retrieve the parameters T, TM, and az from the input arguments using the function
getfuncparams
.
- Define a transformation
Tal
using a rotation matrix for a 180-degree rotation around the y-axis.
- If T is a character string, convert it to a matrix using
SGTget
.
- 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.
- Calculate the size of the bounding box
s
for the transformed SGN and the original SG using sofBB
.
- 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