Syntax
[CPLN,T]=CPLtransrelT(CPL,TA1,TA0)
Input Parameter
CPL : | | Contour for instance a crank |
TA1 : | | 2D Frame or Frame list for example the path of the crank point A1 |
TA0 : | | 2D Frame or Frame list for example the path of the crank origin point A0 |
Output Parameter
CPLN : | | Contour to be move using TA0 |
T : | | Transformation matrix to covert CPL to CPLN |
Examples
CPLtransrelT(CPLC,TA1,TA0);
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, CPLtransrelT
, transforms the pose of a contour (CPL) from one coordinate system to another using transformation matrices.
Input Parameters
- CPL: A contour, such as a crank, represented in a specific coordinate system.
- TA1: A 2D frame or a list of frames representing the path of a point (e.g., crank point A1).
- TA0: A 2D frame or a list of frames representing the path of the origin point (e.g., crank origin point A0).
Output Results
- CPLN: The transformed contour, moved using the transformation matrix derived from TA0.
- T: The transformation matrix used to convert CPL to CPLN.
Algorithm Steps
- Calculate the transformation matrix
T
by taking the inverse of the first frame of TA0
and multiplying it by the first frame of TA1
:
T = inv(TA0(:,:,1)) * TA1(:,:,1);
- Transform the contour
CPL
using the transformation matrix T
to obtain CPLN
:
CPLN = PLtransT(CPL, T);
- If no output arguments are specified, visualize the transformation:
- Plot the original contour
CPL
in green.
- Plot the transformed contour
CPLN
in red.
- Iterate over each frame in
TA1
and TA0
to animate the transformation:
- Delete previous plots.
- Plot the transformed contours for each frame in magenta.
- Update the animation axis and render the frame.
Algorithm explaination created using ChatGPT on 2025-08-19 01:30. (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