centerPL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analytical Geometry
Introduced first in SolidGeometry 3.4, Creation date: 2017-02-01, Last change: 2025-09-14

returns the mean of the convex hull of the point list



See Also: center3P , center4P , centerVL

Example Illustration

 missing image of centerPL(PL)

Syntax

pc=centerPL(PL)

Input Parameter

PL: Point list (n x 2)

Output Parameter

pc: point list center

Examples

try:
centerPL(rand(10,2))




Copyright 2017-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, centerPL, calculates the mean of the convex hull of a given point list. It is part of the SolidGeometry library and was introduced in version 3.4. The function is designed to handle 2D point lists and can also visualize the results if no output arguments are specified.

Input Parameters

Output Results

Algorithm Steps

  1. Suppress specific warnings related to duplicate points in Delaunay triangulation.
  2. Remove any NaN values from the input point list PL using the function woNaN.
  3. Compute the Delaunay triangulation of the cleaned point list PLN.
  4. Check if the triangulation connectivity list is not empty:
  5. If the triangulation connectivity list is empty, calculate the mean of the non-NaN points as the center pc.
  6. If the point list has a third dimension, retain the z-coordinate from the first point.
  7. If additional output arguments are requested or none are specified:
  8. If no output arguments are specified, visualize the results:
Algorithm explaination created using ChatGPT on 2025-08-19 00:44. (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