Find an Online Tutor Now

Asked • 03/27/19

How to determine if a point is within a quadrilateral?

**Goal** I want to determine if a test point is within a defined quadrilateral. I'm probably going to implement the solution in Matlab so I only need pseudo-code. **Inputs** Corners of quadrilateral : (x1,y1) (x2,y2) (x3,y3) (x4,y4) Test point : (xt, yt) **Output** 1 - If within quadrilateral 0 - Otherwise **Update** It was pointed out that identifying the vertices of the quadrilateral is not enough to uniquely identify it. You can assume that the order of the points determines the sides of the quadrilateral (point 1 connects 2, 2 connects to 3, 3 connects to 4, 4 connects to 1)

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.