insideCPS
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Analyzing function
Introduced first in SolidGeometry 4.5, Creation date: 2019-03-01, Last change: 2025-09-14
tests whether a point list is inside of a CPL polyshape or CPS
Description
SLOW FUNCTION FOR SINGLE POINTS - Use distanceVLtoVLEL to search on Contours
Replaces insideC, insidePLEL, insideinsidePLELdelaunay (which is TL's implementation of insideCPS)
In contrast to insideC, this function supports and uses the polyshape concept with several regions and holes: if there is no need for inside and on contour use "isinterior" directly
+1 means point is inside
-1 means point is outside
0 means point is on the contour
See Also: , insidePLELdelaunay
Example Illustration
Syntax
k=insideCPS(CPL,PL);
Input Parameter
CPL: | | Vertex list of the contour |
PL: | | Point to check |
Output Parameter
k: | | +1==inside, -1==outside, 0== on the contour |
Examples
CPL=[PLsquare(6,4);nan nan;PLsquare(3,2)];
insideCPS(CPL,[-1 -1; -1 0; -1 1.5; -1 2.5; -1 -2])
insideCPS(CPL,[-1 -1; -1 0; -1 1.5; -1 2.5; -1 -2]+[-2 0])
Copyright 2019-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
Last html export of this page out of FM database by TL: 2025-09-21