Find if a point lies bellow or above a curve
Ältere Kommentare anzeigen
Is it possible to find if a point lies under a curve C if the curve is not defined by an equation but by points? Say we have point Po(Xo,Yo) and I want to find if this Po is located below, under or on the curve.
Any ideas of how to do that?
I can only think of the following method:
- Drawing a line 'l' connecting (0,0),Po, the curve
- Finding the coordinates of the point P1 at which 'l' crosses the curve.
- Measuring the distance from (0,0) to Po = d1 and comparing it with the distance from (0,0) to P1 =d2
- If the d1>d2, Po is above, else, it is below
The problems:
- I don't know how to make the line go through the curve
- I don't know how to find the coordinates of the point at which the line crosses the curve
I know this might be a simple question for most of you but mathematically I can only think of formulas related to polygons, circles, triangles...etc. not for assymptotic curve.
Thank you!
Lina
1 Kommentar
If your curve C is convex (or concave), then you can find this easily by solving a linear system to find the linear combination of curve-points that give your query-point (regularised in the least-squared sense). Otherwise, if your curve doesn't have too many points, you can simply check whether your query-point is under/over each line-segment that makes up your curve (consecutive pairs of curve-points).
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Interpolation finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
