Trotate

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

returns a HT matrix rotated by



See Also: SGrotate , TofTrel , TofT

Example Illustration

 missing image of Trotate(T,ax,val)

Syntax

NT=Trotate(T,[ax,val])

Input Parameter

T: Transformation matrix
ax: rotation axis 'x,'y','z' or axial, coronal, sagittal
val: value; default is p/2

Output Parameter

NT: New Transformation matrix

Examples


Trotate(eye(4),'s')




Copyright 2020-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, Trotate, is designed to apply a rotation to a given transformation matrix T. It is part of the SolidGeometry library and is used for kinematics and frame transformations.

Input Parameters

Output

Algorithm Steps

  1. Check if the transformation matrix T is empty. If it is, an error is thrown.
  2. Retrieve the rotation axis (ax) and the rotation value (val) from the input parameters. If not provided, default values are used.
  3. Convert the axis to lowercase and initialize a 3x3 identity matrix R for rotation.
  4. If val is a scalar, replicate it to match the length of ax.
  5. Iterate over each character in ax to determine the rotation:
  6. Update the transformation matrix NT by applying the rotation matrix R to T. If T is a 3D matrix, apply the rotation to each slice.
  7. If no output is requested, plot the new transformation matrix using SGfigure and tplot functions.
Algorithm explaination created using ChatGPT on 2025-08-19 07:56. (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