by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Spatial Relations
Introduced first in SolidGeometry 1.1, Creation date: 2013-12-27, Last change: 2025-09-14
See Also: PLtransP
, PLtransR
, PLtrans
, PLtrans0
, PLtrans1
, PLtransT
, PLtransC
PL=PLtransP(PL,p)
PL: | Point list nx2 | |
p: | translation vector 1x2 |
PL: | Translated point list |
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.
nx2 matrix, where n is the number of points. Each row corresponds to a point with its x and y coordinates.1x2 array. It contains the translation values for the x and y coordinates.p.p is explicitly defined as a 1x2 array to ensure it has the correct dimensions.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.PL is then added to this replicated matrix, effectively translating each point by the vector p.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.