Syntax
[P,k]=PLminxy(PL,[maxX])
Input Parameter
PL : | | Point Liste |
maxX : | | if true; we search for maximum y and maximum x |
Output Parameter
P : | | Point with minimal y and minimal x |
k : | | find index in PL |
Examples
CPLB=CPLspiral(10,20,8*pi);
PLminxy(CPLB)
PLminxy(CPLB,true)
[~,k]=PLminxy(CPLB); CPLB=circshift(CPLB,-k);
Copyright 2020-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, PLminxy
, is designed to find a specific point in a list of points, PL
. The function can either find the point with the minimal x and y values or, if specified, the point with the maximal x and minimal y values.
Input Parameters
- PL: A list of points, where each point is represented by its x and y coordinates.
- maxX (optional): A boolean parameter. If set to
true
, the function searches for the point with the maximum x and minimum y values. If omitted or set to false
, it searches for the point with the minimum x and y values.
Output Results
- P: The point with the desired x and y values based on the
maxX
parameter.
- k: The index of the point
P
in the original list PL
.
Algorithm Steps
- Store the original list of points
PL
in PLorg
.
- Round the coordinates in
PL
to 5 decimal places for precision.
- Extract only the x and y coordinates from
PL
.
- Determine the value of
maxX
using getfuncparams
, defaulting to false
if not provided.
- If
maxX
is false
, find the points with the minimum x value. If maxX
is true
, find the points with the maximum x value.
- Among the points found in the previous step, find the one with the minimum y value.
- Identify the index
k
of this point in the original list PLorg
.
- Assign the point
P
from PLorg
using the index k
.
- If no output is requested, plot the points using
SGfigure
, highlighting the point P
in red.
Algorithm explaination created using ChatGPT on 2025-08-19 00:07. (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