wofT

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 4.5, Creation date: 2019-04-11, Last change: 2025-09-14

returns simply the squeezed atan2 of the rotation matrix of T



See Also: rot , TofR

Example Illustration

 missing image of wofT(T2)

Syntax

w=wofT(T2)

Input Parameter

T2: HT Matrix in 2D = 3x3xM

Output Parameter

w: angle list

Examples


wofT(TofR(rot(pi/3)))-pi/3




Copyright 2019-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, wofT, is designed to compute the angle from a 2D homogeneous transformation matrix. It is part of the SolidGeometry library and was introduced in version 4.5. The function is authored by Tim Lueth and is intended for analytical geometry applications.

Input Parameters

Output Results

Algorithm Explanation

The function begins by checking if the second dimension of the input matrix T2 is equal to 3. This check ensures that the input is a 3x3 matrix, which is a requirement for 2D homogeneous transformation matrices.

If the input matrix meets this condition, the function proceeds to calculate the angle using the atan2 function. The atan2 function computes the arctangent of the quotient of its arguments, which in this case are the elements T2(2,1,:) and T2(1,1,:) of the matrix. These elements correspond to the sine and cosine of the rotation angle, respectively.

The squeeze function is then used to remove any singleton dimensions from the resulting array, effectively producing a list of angles.

If the input matrix does not meet the 3x3 requirement, the function throws an error message indicating that the implementation is only available for 2D matrices. It suggests using the rotm2eul function from Peter Corke's library for Euler angles in other dimensions.

Example Usage

An example provided in the comments demonstrates the use of the function:

w = wofT(TofR(rot(pi/3))) - pi/3

This example shows how to use the function to compute the angle from a rotation matrix generated by a rotation of pi/3 radians.

Algorithm explaination created using ChatGPT on 2025-08-18 22:10. (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