How to find if a point lies in the area covered by 2 straight lines

1.3k Views Asked by At

Given 2 lines

Y1 = m1X1 + C1
Y2 = m2X2 + C2

Now given a point (X3,Y3), how will one find whether the point lies in the area enclosed by the 2 straight lines?

In other words, one is to find if (X3,Y3) lies in the shaded region.

enter image description here

2

There are 2 best solutions below

0
On BEST ANSWER

Check the inequality formed by the two lines. For example, take the line $y=2x$ and the line $y=-2x+2$. If I wanted to see if a point $(x_0,y_0)$ was in the region 'between' these two lines in Quadrant $1$ or Quadrant $4$, I would check to see if $(x,y)$ satisfied $$ \begin{align} y&>-2x+2 \\ y&<2x \end{align} $$ for $x=x_0$ and $y=y_0$.

enter image description here

The point $(2,1)$ clearly satisfies this and is 'in-between' the two lines; however, the point $(1,6)$ does not and is not in our region. Graph and check these for yourself to help understand why this works.

0
On

To determine if $(x_0,y_0)$ lies above one of the lines $\ell_1: y = m_1x+c_1$ and $\ell_2: y = m_2x+c_2$ and below the other, we have two cases:

If the point $(x_0,y_0)$ lies above $\ell_1$ and below $\ell_2$, then $m_1x_0 + c_1 < y_0 < m_2x_0 + c_2$.

If the point $(x_0,y_0)$ lies below $\ell_1$ and above $\ell_2$, then $m_1x_0 + c_1 > y_0 > m_2x_0 + c_2$.