randT

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 4.4, Creation date: 2018-12-08, Last change: 2025-09-14

return a random T matrix



See Also: randminv

Example Illustration

 missing image of randT(d)

Syntax

T=randT([d])

Input Parameter

d: distance from original; default is 10..20

Output Parameter

T: HT Matrix

Examples


randT




Copyright 2018-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 algorithm generates a random transformation matrix, often used in 3D graphics and robotics. The function is named randT and is part of the SolidGeometry library.

Input Parameters

Output

Algorithm Steps

  1. The function getfuncparams is called to retrieve the parameter d from the input arguments. If not specified, it defaults to 20.
  2. The function randminv is used to generate a random translation vector t with three components. Each component is a random value between d/2 and d.
  3. Random rotation angles wx, wy, and wz are generated using randminv. These angles are within the range of [pi/10, 2*pi*0.9] - pi.
  4. The function rot is called with the angles wx, wy, and wz to create a rotation matrix R.
  5. The function TofR is used to combine the rotation matrix R and the translation vector t into a homogeneous transformation matrix T.
  6. If no output is requested (i.e., nargout == 0), a figure is created using SGfigure. The maximum value of t is used to set the view, and the transformation is plotted with tplot. The origin is marked with pplot.
Algorithm explaination created using ChatGPT on 2025-08-18 22:36. (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