TofT

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 4.1, Creation date: 2017-08-20, Last change: 2025-09-14

returns a T matrix defined relative to another T matrix

Description

This function help to specify a new matrix relative to an existing one. This is helpful to define cutting planes for SGcutT for example.
In fact it is the same as T1=T0*TofR(R,P) but may be easier to understand.

See Also: TofR , TofVL , TPL , TofDPhiH , T3ofT2 , Tof3P , T2P , TofP , TofPez , TofPEul , TofTrel

Example Illustration

 missing image of TofT(T0,R,P)

Syntax

T1=TofT(T0,[R,P])

Input Parameter

T0: Original Matrix
R: Rotation matrix relative to the T axis; scalar=phiz
P: Translation vector relative to the T axis; scalar=z

Output Parameter

T1: resulting new T Matrix

Examples


TofT(TofP([10 10 10]),10)
TofT(TofP([10 10 10]),rot(0,0,pi))
TofT(TofP([10 10 10]),pi/2,2)




Copyright 2017-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, TofT, is designed to compute a new transformation matrix T1 relative to an existing transformation matrix T0. It is part of the SolidGeometry library and is useful for defining new coordinate systems or transformation matrices, particularly in applications like defining cutting planes.

Input Parameters

Output

Algorithm Steps

  1. Initialize the rotation matrix R to the identity matrix if not provided.
  2. Initialize the translation vector P to zero if not provided.
  3. Check if R is a scalar. If so, convert it to a rotation matrix using the rot function, assuming a rotation around the z-axis.
  4. If R is not a square matrix, assume it is a vector and convert it to a rotation matrix using the rot function.
  5. Check if P is a scalar. If so, convert it to a 3-element vector with the scalar as the z-component.
  6. Initialize T1 as a copy of T0.
  7. Update the translation part of T1 by adding the product of T0's rotation part and the translation vector P to T0's translation part.
  8. Update the rotation part of T1 by multiplying it with the rotation matrix R.
  9. If no output is requested, visualize the original and resulting transformation matrices using the SGfigure and tplot functions.

Example Usage

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