Syntax
T=randT([d])
Input Parameter
d : | | distance from original; default is 10..20 |
Output Parameter
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
- d: This parameter represents the distance from the origin. If not provided, it defaults to a range between 10 and 20.
Output
- T: The output is a homogeneous transformation (HT) matrix.
Algorithm Steps
- The function
getfuncparams
is called to retrieve the parameter d
from the input arguments. If not specified, it defaults to 20.
- 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
.
- 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
.
- The function
rot
is called with the angles wx
, wy
, and wz
to create a rotation matrix R
.
- The function
TofR
is used to combine the rotation matrix R
and the translation vector t
into a homogeneous transformation matrix T
.
- 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