# Is the point is out of quadrilateral

Status
Not open for further replies.

#### mohanchandra

##### New Member
how to check whether the point is out of quadrilateral or not ?

i have quadrilateral. its points are (x1,y1),(x2,y2),(x3,y3),(x4,y4).
how do u check the point (x5,y5) is out of quadrilateral or not

Last edited:

#### dknguyen

##### Well-Known Member
Make four equations- one representing each side of the shape from your 4 points (the equation for a line ). Then plug in the 5th point into the equation to check if the point is within the bounds of the lines represented by each equation (ie. between the left and right sides and between the top and bottom sides) using less/greater than.

Last edited:

#### Tesla23

##### Member
i have quadrilateral. its points are (x1,y1),(x2,y2),(x3,y3),(x4,y4).
how do u check the point (x5,y5) is out of quadrilateral or not
Find a diagonal (trivial if your quadrilateral is convex, otherwise needs care) and reduce problem to two triangles. There are fast triangle hit test algorithms out there (use google), I think using barycentric coordinates is one of the best.

#### jasonbe

##### New Member 