Syntax
PL=PLtransP(PL,p)
Input Parameter
PL : | | Point list nx2 |
p : | | translation vector 1x2 |
Output Parameter
PL : | | Translated point list |
Copyright 2013-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, PLtransP
, is designed to translate a list of points in a 2D space by a given translation vector. It is part of the SolidGeometry library and was introduced in version 1.1.
Input Parameters
- PL: A point list represented as an
nx2
matrix, where n
is the number of points. Each row corresponds to a point with its x and y coordinates.
- p: A translation vector represented as a
1x2
array. It contains the translation values for the x and y coordinates.
Output Results
- PL: The translated point list, which is the original list of points shifted by the translation vector
p
.
Algorithm Steps
- The translation vector
p
is explicitly defined as a 1x2 array to ensure it has the correct dimensions.
- The function uses the
repmat
function to replicate the translation vector p
to match the number of points in PL
. This creates a matrix of the same size as PL
where each row is the translation vector.
- The original point list
PL
is then added to this replicated matrix, effectively translating each point by the vector p
.
- If the function is called without an output argument, it automatically plots the translated points using the
PLplot
function. The view is set to a top-down perspective with view(0,90)
, and the plot is configured with equal axis scaling, grid lines, and axis visibility.
Algorithm explaination created using ChatGPT on 2025-08-18 22:28. (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