Syntax
[dmin,ei]=CPLdisttopoint(CPL,[p])
Input Parameter
CPL : | | Closed polygon line |
p : | | point of interest; default is [0 0] |
Output Parameter
dmin : | | minmal circle radius that touches the contour. negative if outside |
ei : | | |
Examples
CPLdisttopoint(CPLofPL(PLcircle(10,3)),[-6 0]) % Inside and nearest edge => positive d
CPLdisttopoint(CPLofPL(PLcircle(10,3)),[-12 0]) % Outside and nearest Point => negative d
CPLdisttopoint(CPLofPL(PLcircle(10,4)),[-12 0]) % Outside and nearest edge => negative d
References
https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line
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
Last html export of this page out of FM database by TL: 2025-09-21