1
$\begingroup$

This question already has an answer here:

I have a quadrangle which sides consist of parts of rays, and I only know the coordinates of two points on each ray.

I need to determine if a point $(x,y)$ lies in such quadrangle.

In this picture, I painted the sides of the quadrangle red in case you don't understand about what quadrangle I'm talking.

$\endgroup$

marked as duplicate by Dr. Mathva, Lee David Chung Lin, Leucippus, Cesareo, YiFan Apr 17 at 13:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Can you determine the intersection points of the rays? $\endgroup$ – Dr. Mathva Apr 6 at 18:04
  • $\begingroup$ I multplied LHS of their equations as following. Can you check the sign of this product? And the logic? $$(\frac{x}{5}+ \frac{y}{3}-1).(\frac{x}{4}+ \frac{y}{-7}-1).(\frac{x}{-8}+ \frac{y}{-12}-1).(\frac{x}{5}+ \frac{y}{-2}-1) $$ $\endgroup$ – Narasimham Apr 17 at 13:51
1
$\begingroup$

Let $A(x_a, y_a), B(x_b, y_b), C(x_c, y_c)$ and $D(x_d, y_d)$ form the quadrilateral $ABCD$ with area $S$ and let $P$ be the point you've chosen.

Calculate the areas of the triangles $\triangle PAB, \triangle PBC, \triangle PCD$ and $\triangle PDA$, for instance, with the shoelace formula. Let their sum be $S'$. Then

\begin{align*} S'=S&\implies P\text{ lies inside }ABCD\\ S'>S&\implies P\text{ lies outside } ABCD \end{align*}

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.