PLtransC

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Spatial Relations
Introduced first in SolidGeometry 4.2, Creation date: 2018-07-31, Last change: 2025-09-14

rotates a point list around a center



See Also: PLtransP , PLtransR , PLtrans , PLtrans0 , PLtrans1 , PLtransT

Example Illustration

 missing image of PLtransC(PL,C,w)

Syntax

PL=PLtransC(PL,C,w)

Input Parameter

PL: Point List [nx2]
C: Center of rotation default is zero
w: angle of rotation default is pi/2

Output Parameter

PL: Resulting Point list

Examples


PLtransC(PLsquare(30,20),[0 50],pi/4)




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 function, PLtransC, rotates a list of points around a specified center by a given angle. It is part of the SolidGeometry library.

Input Parameters

Output

Algorithm Steps

  1. Store the original point list PL in OPL for later use.
  2. If w is a vector, calculate the angle using atan2(-w(2), -w(1)).
  3. Translate the point list PL by subtracting the center C.
  4. Rotate the translated points by multiplying with the rotation matrix rot(-w).
  5. Translate the points back by adding the center C.
  6. If no output is requested (nargout==0), plot the original and transformed point lists using SGfigure and CPLplot.
Algorithm explaination created using ChatGPT on 2025-08-18 23:04. (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