Determine if a point is between two lines

1.2k Views Asked by At

First of all, I'm not a math whiz and haven't taken a math class in 20+ years, so be gentle with me. I'm trying to figure out how to make a spreadsheet for airplane weight and balance.

I have two straight lines. The first line has a point at 43.75, 1300 and a second point at 52.5, 1600.

The second line has points at 47.5, 1150 and a second point at 60, 1600.

I am trying to figure out a formula where I can plug in a point and determine mathmatically if the point is between the lines. So for instance I want to know if 55.2, 1547 is between the lines or outside the lines.

These lines are part of a moment envelope. The y for the point we want to examine will never be greater than 1600 nor less than 1150.enter image description here

So it seems I'd need to figure out if x for any given y is greater than what x is for the "left" line at the same y and then less than x for the "right" line at the same y. So I'd need to find what the coordinates of the line are for a given y and the slope of the line. Am I on the right track?

1

There are 1 best solutions below

1
On BEST ANSWER

The equation of a line is of the form $y=mx+n$ with $m=\frac{\Delta y}{\Delta x}$ $$m_1=\frac{1600-1200}{52.5-41.25}\approx 35.56 \qquad n_1=1600-52.5m_1 \approx -267$$ $$m_2=\frac{1600-1150}{60-47.5}=36 \qquad n_2=1600-60m_2=-560$$ You want the point to be below the first and above the second line so its coordinates have so satisfy $$36x-560<y<35.56x-267$$ Since the plot is pretty bad you could consider $m_1\approx m_2$ which would simplify the formula to $$267<36x-y<560$$