Tofchar

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

creates an HT frame based on spatial relations



See Also: Ttransrel , ezofchar

Example Illustration

 missing image of Tofchar(T,relparam)

Syntax

TN=Tofchar([T,relparam])

Input Parameter

T: char of ez, or empty for eye(4)
relparam: additional relative parameters for Ttransrel

Output Parameter

TN: new T matrix

Examples


Tofchar('y') % ez = ey
Tofchar('x','roty',pi) % ez = x and rotated aorund ey
Tofchar('rotz',pi))




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, Tofchar, is designed to create a homogeneous transformation (HT) frame based on spatial relations. It is part of the SG-Library and was introduced in SolidGeometry 5.2.

Input Parameters

Output

Algorithm Steps

  1. Retrieve the first input parameter T using getfuncparams.
  2. If T is a character and corresponds to a valid axis, convert it to a transformation matrix using TofPez and ezofchar.
  3. If T is a 1x3 vector, convert it to a transformation matrix using TofPez.
  4. If T is a 4x4 matrix, remove the first element from varargin. Otherwise, set T to the identity matrix eye(4).
  5. If additional parameters are provided in varargin, apply Ttransrel to T with these parameters to compute TN. Otherwise, set TN to T.
  6. If no output is requested, calculate the norm of the translation vector difference between T and TN. Use this to scale the plot size.
  7. Plot the original transformation T and, if different, the new transformation TN using SGfigure and tplot.
Algorithm explaination created using ChatGPT on 2025-08-19 01:18. (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