PLnorm

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 1.0, Creation date: 2012-07-10, Last change: 2025-09-14

returns a normalize vector list nx2


Will be removed (2025-09-21): Use 'normr, vecnormr' instead

Description

Since Matlab 2017, there is vecnorm as Matlab function.
Calculation of adjusted 2025-07-20


See Also: , vecnormr , PLnorm , PLELnorm , PLFLfaceNormal , VLnorm , VLFLfaceNormal

Example Illustration

 missing image of PLnorm(PL)

Syntax

[NL,DL]=PLnorm(PL)

Input Parameter

PL: Vector list

Output Parameter

NL: Normalize vector list
DL: Length list

Examples


PL=PLsquare(10,30)+40, [a,b]=PLnorm(PL), NL=normr(PL), DL=vecnormr(PL-circshift(PL,-1))




Copyright 2012-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)

The function PLnorm is designed to normalize a vector list and optionally return the lengths of these vectors. It is part of the SolidGeometry library and was introduced by Tim Lueth. The function is considered obsolete as of July 20, 2025, and users are encouraged to use normr and vecnormr instead.

Input Parameters

Output Results

Algorithm Explanation

The function begins by normalizing the input vector list PL using the normr function, which scales each vector to have a unit length. This result is stored in NL.

If the function is called with two output arguments, it calculates the lengths of the vectors in PL using the vecnormr function. This is done by first computing the difference between each vector and its subsequent vector using circshift(PL,-1), which shifts the rows of PL circularly. The lengths are then stored in DL.

The original code snippet included a commented-out loop that manually calculated the lengths and normalized vectors, but this has been replaced by the more efficient normr and vecnormr functions.

The function is straightforward and does not include any switch conditions or additional cases.

Algorithm explaination created using ChatGPT on 2025-08-19 01:24. (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