Filter löschen
Filter löschen

How do I tell if a point is in or on a boundary set by equations

12 Ansichten (letzte 30 Tage)
I have a power curve, horizontal line, vertical line, and a linear line. The four of these enclose a region on a plot. I am looking to see if a user-inputted point is within or on the boundary. If anyone could guide me into the right direction, I would appreciate it.

Akzeptierte Antwort

Star Strider
Star Strider am 1 Nov. 2018
The inpolygon (link) function could be helpful.
  4 Kommentare
Andrew Padilla
Andrew Padilla am 1 Nov. 2018
Strider,
I figured out a solution. It turns out, inpolygon() can be used to help out. Because the other equations are linear, in_polygon() will work for those boundaries. It fails where the shape is bounded by the power curve. Because of this, I have to check that the y value is greater than the x of the y value plugged in to the power curve equation. With that said, I created a conditional statement that checked if the y value was greater AND in or on is equal to one. If both of these are true, the point is in the shape. I will accept this as an answer because it did guide me to getting the answer.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by