PLminyx

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 2.7, Creation date: 2015-10-01, Last change: 2025-09-14

returns the point with minimal y and x value



See Also: PLminangle , PLminxy

Example Illustration

 missing image of PLminyx(PL,maxY)

Syntax

[P,pi]=PLminyx(PL,[maxY])

Input Parameter

PL: Point Liste
maxY: if true; we search for maximum y and maximum x

Output Parameter

P: Point with minimal y and minimal x
pi: find index in PL

Examples


CPLB=CPLspiral(10,20,8*pi);
PLminyx(CPLB)
PLminyx(CPLB,true)
[~,ci]=PLminyx(CPLB); CPLB=circshift(CPLB,-(ci-1));




Copyright 2015-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, PLminyx, is designed to find a specific point in a list of points, PL. The point is determined based on its y and x values, either minimal or maximal, depending on the input parameters.

Input Parameters

Output Results

Algorithm Steps

  1. Store the original list of points PL in PLorg.
  2. Round the coordinates in PL to 5 decimal places for precision.
  3. Extract only the first two columns of PL, assuming these are the x and y coordinates.
  4. Initialize maxY to false. If a second argument is provided and is not empty, set maxY to the value of this argument.
  5. Based on the value of maxY:
    • If maxY is false, find the minimum y value in PL. Then, find the minimum x value among the points with this y value.
    • If maxY is true, find the maximum y value in PL. Then, find the maximum x value among the points with this y value.
  6. Set P to the point with the determined x and y values.
  7. Find the index k of this point in the original list PLorg.
  8. If no output is requested, plot the points using SGfigure and highlight the found point.
Algorithm explaination created using ChatGPT on 2025-08-19 00:38. (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