CPLlength

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PL/Point Lists
Introduced first in SolidGeometry 5.1, Creation date: 2022-02-18, Last change: 2025-09-15

returns the boundary length of a CPL

Description

same as ps=polyshape(CPL(:,1),CPL(:,2)); len=ps.perimeter;


See Also: CPLarea

Example Illustration

 missing image of CPLlength(CPL)

Syntax

len=CPLlength(CPL)

Input Parameter

CPL: CPL

Output Parameter

len: len of contur line

Examples


CPLlength(PLsquare(10))




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 calculates the boundary length of a Closed Polygon List (CPL).

Input Parameters

Output Results

Algorithm Steps

  1. Create a polyshape object using the x and y coordinates from the CPL matrix: ps=polyshape(CPL(:,1),CPL(:,2));
  2. Calculate the perimeter of the polyshape object: len=ps.perimeter;
  3. If the calculated length is zero, perform the following steps:

Example

To calculate the length of a square with side length 10:

CPLlength(PLsquare(10))
Algorithm explaination created using ChatGPT on 2025-08-18 22:39. (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