# Triangle formed by straight lines

• Einstein44
In summary, the OP tried to solve this problem using the notation y=-mx+c, but it gave the incorrect answer because the origin (0,0) lies on the graph and hence the inequality symbol y\geq0 is not satisfied.

#### Einstein44

Homework Statement
A triangle in the plane is formed by straight lines
##\left.\begin{matrix}
2x+y=2\\
2x+3y=6\\
x-y=1
\end{matrix}\right\}##

Which of the points P(1,1) and Q(1,2) lie in the interior of the triangle and which outside the triangle?

NOTE: No drawings or sketches are allowed as part of the solution.
Relevant Equations
.
I tried doing this problem, but couldn't find a solution that wouldn't involve a sketch... Finding the vertices was all I've got.

The triangle is the intersection of three half-planes defined by the inequalities obtained by replacing each of the equals signs in the above three equations by either ##\geq## or ##\leq##.
Once you have done those replacements, you can check whether a point is in the triangle by just testing whether it obeys all three inequalities.
For each equation, work out whether to replace the equals sign by ##\geq## or ##\leq## by finding the point of intersection of the other two lines - which you know lies on the triangle - and seeing whether it obeys the inequality with the equals replaced by ##\geq## or ##\leq##.

Office_Shredder and Einstein44
andrewkirk said:
The triangle is the intersection of three half-planes defined by the inequalities obtained by replacing each of the equals signs in the above three equations by either ##\geq## or ##\leq##.
Once you have done those replacements, you can check whether a point is in the triangle by just testing whether it obeys all three inequalities.
For each equation, work out whether to replace the equals sign by ##\geq## or ##\leq## by finding the point of intersection of the other two lines - which you know lies on the triangle - and seeing whether it obeys the inequality with the equals replaced by ##\geq## or ##\leq##.
This can't be quite right. If we try the origin in the third equation, then ##x = 0, y = 0 \ \Rightarrow \ x - y < 1##. But, if we replace the third equation with the equivalent ##y - x = -1##, then we find the opposite inequality for the origin.

I suggest you first have to rewrite the equations in the standard form ##y = mx + c##.

chwala and FactChecker
Einstein44 said:
I tried doing this problem, but couldn't find a solution that wouldn't involve a sketch...
Neither could I.

I did it the way I described, and it gave the correct answer. I can't give details though, as I need to leave some work for the homework posters to do, so they can learn.

I don't see why the observation regarding the origin should cause an objection.

The LHS of each equation is a linear function of x and y, and all level sets (iso-lines) of such a function are parallel to one another. A given RHS number, with an equals sign, defines a specific iso-line, and all level sets giving less than that number are on one side of that, while all those giving more are on the other. If we change the linear function - we can expect the level sets and the chosen inequalities to change. If we change the function only by multiplying by a constant, the level sets will not change, but the values on each set will. If the constant is negative, eg when we replace ##x-y## by ##y-x## (constant is -1), the inequality will change.

andrewkirk said:
I did it the way I described, and it gave the correct answer. I can't give details though, as I need to leave some work for the homework posters to do, so they can learn.

I don't see why the observation regarding the origin should cause an objection.
Let's see what the OP comes up with. I'm interested in what your criteria are for a point lying inside the triangle.

andrewkirk said:
The triangle is the intersection of three half-planes defined by the inequalities obtained by replacing each of the equals signs in the above three equations by either ##\geq## or ##\leq##.
Once you have done those replacements, you can check whether a point is in the triangle by just testing whether it obeys all three inequalities.
For each equation, work out whether to replace the equals sign by ##\geq## or ##\leq## by finding the point of intersection of the other two lines - which you know lies on the triangle - and seeing whether it obeys the inequality with the equals replaced by ##\geq## or ##\leq##.
Okay so I have tried to work this out like you said, although a bit confused. Please correct me if I did any mistakes in here.

First rearranged the equations in the form ##y=mx+c##:
##
\left.\begin{matrix}
y= -2x+2\\
y=-\frac{2}{3}x+2\\
y=x-1
\end{matrix}\right\}triangle
##
Then, finding the vertices by equating all of the equations returns the 3 points:
##
\left.\begin{matrix}
A (0,2)\\
B (1,0)\\
C(\frac{9}{5}, \frac{4}{5})
\end{matrix}\right\}
##
Then, for example, for the first equation, ##y= -2x+2##, using the intersect between the other two lines, which is point ##C##, shows me that it must lie above the line and hence give the inequality ##y\geq -2x+2##
Thus, inserting point ##P(1,1)## into this inequality returns ##1\geq0##, which is ##\top##
I repeated this for all other inequalities, for point P, as well as Q. Point P was all ##\top## and some for Q were false, concluding that P lies within the triangle and Q outside of it.

I also checked the inequality symbols by inserting a point (0,0) to be sure. I am not sure if I have done this correctly, but that is all I could come up with. Please correct me.

Last edited:
Einstein44 said:
Okay so I have tried to work this out like you said, although a bit confused. Please correct me if I did any mistakes in here.

First rearranged the equations in the form ##y=mx+c##:
##
\left.\begin{matrix}
y= -2x+2\\
y=-\frac{2}{3}x+2\\
y=x-1
\end{matrix}\right\}triangle
##
Then, finding the vertices by equating all of the equations returns the 3 points:
##
\left.\begin{matrix}
A (0,2)\\
B (1,0)\\
C(\frac{9}{5}, \frac{4}{5})
\end{matrix}\right\}
##
Then, for example, for the first equation, ##y= -2x+2##, using the intersect between the other two lines, which is point ##C##, shows me that it must lie above the line and hence give the inequality ##y\geq -2x+2##
Thus, inserting point ##P(1,1)## into this inequality returns ##1\geq0##, which is ##\top##
I repeated this for all other inequalities, for point P, as well as Q. Point P was all ##\top## and some for Q were false, concluding that P lies within the triangle and Q outside of it.

I also checked the inequality symbols by inserting a point (0,0) to be sure. I am not sure if I have done this correctly, but that is all I could come up with. Please correct me.
I couldn't do this without using a sketch to justify the criteria. Eventually, we can perhaps state the purely algebraic criteria with confidence and who's to say that we needed a sketch to come up with the criteria in the first place? As long as you don't submit the sketch as part of your solution!

Let's take the two points we are given, ##P## and ##Q##, and add the origin ##O## as well to give us more data. Now, taking the lines in the order given, we plug in the ##x## value of our point and say whether the ##y## value is greater than or less than the expression in ##x## on the RHS:

For the point ##P(1,1)## we have: ##>, <, >##

For the point ##Q(1, 2)## we have: ##>, >, >##.

For the origin ##O(0,0)## we have: ##<, <, >##.

You could choose some other points inside the triangle or at locations outside the triangle and look at the three inequalities and see whether you can deduce a pattern for points inside and outside the triangle.

Einstein44

Calculate the areas of the various triangles: ##A_0=##Area(ABC), ##A_1=##Area(ABP), ##A_2=##Area(BCP) and ##A_3##=Area(CAP).

If P is internal (or lies on a side), what is the relationship between ##A_0, A_1, A_2## and ##A_3##?

If using this approach, there is handy formula (if allowed) for a triangle’s area in terms of the coordinates of its vertices, e.g. see https://mathopenref.com/coordtrianglearea.html.

Einstein44
Steve4Physics said:

Calculate the areas of the various triangles: ##A_0=##Area(ABC), ##A_1=##Area(ABP), ##A_2=##Area(BCP) and ##A_3##=Area(CAP).

If P is internal (or lies on a side), what is the relationship between ##A_0, A_1, A_2## and ##A_3##?

If using this approach, there is handy formula (if allowed) for a triangle’s area in terms of the coordinates of its vertices, e.g. see https://mathopenref.com/coordtrianglearea.html.
I suspect the simplest approach is to look at the point in relation to the lines given!

Steve4Physics said:

Calculate the areas of the various triangles: ##A_0=##Area(ABC), ##A_1=##Area(ABP), ##A_2=##Area(BCP) and ##A_3##=Area(CAP).

If P is internal (or lies on a side), what is the relationship between ##A_0, A_1, A_2## and ##A_3##?

If using this approach, there is handy formula (if allowed) for a triangle’s area in terms of the coordinates of its vertices, e.g. see https://mathopenref.com/coordtrianglearea.html.
Yes, I believe this would work, although perhaps more complicated. The solution refers to a method like the one stated by several threads above, however it is written in a way that does not really make sense on its own. The only thing I can tell is the use of some inequalities.
That's why I wanted to first try the method given in the solution, as I believe this problem is expecting me to use inequalities.

Steve4Physics
PeroK said:
I couldn't do this without using a sketch to justify the criteria. Eventually, we can perhaps state the purely algebraic criteria with confidence and who's to say that we needed a sketch to come up with the criteria in the first place? As long as you don't submit the sketch as part of your solution!

Let's take the two points we are given, ##P## and ##Q##, and add the origin ##O## as well to give us more data. Now, taking the lines in the order given, we plug in the ##x## value of our point and say whether the ##y## value is greater than or less than the expression in ##x## on the RHS:

For the point ##P(1,1)## we have: ##>, <, >##

For the point ##Q(1, 2)## we have: ##>, >, >##.

For the origin ##O(0,0)## we have: ##<, <, >##.

You could choose some other points inside the triangle or at locations outside the triangle and look at the three inequalities and see whether you can deduce a pattern for points inside and outside the triangle.
What does that information about whether the retuned y-value from the functions is greater or lower than the one from the point?

Einstein44 said:
What does that information about whether the retuned y-value from the functions is greater or lower than the one from the point?
I can't make sense of that question.

PeroK said:
I can't make sense of that question.
"Let's take the two points we are given, P and Q, and add the origin O as well to give us more data. Now, taking the lines in the order given, we plug in the x value of our point and say whether the y value is greater than or less than the expression in x on the RHS:"

I am not sure what to conclude from this

This is the solution:
Unfortunately I was not able to make sense of it, but perhaps it makes more sense now that I saw all the replies here.

The values of the linear functions which determine the sides of the triangle ##a(x,y) = 2x+y-2##, ##b(x,y)=2x-3y-6##, ##c(x,y)=x-y-1## opposite to vertices A, B, and C, correspondingly, take at these vertices signs +, −, −. At the point P they take signs +, −, −, and point Q signs +, +, −. Therefore P belongs to the interior of the triangle and Q does not

Einstein44 said:
"Let's take the two points we are given, P and Q, and add the origin O as well to give us more data. Now, taking the lines in the order given, we plug in the x value of our point and say whether the y value is greater than or less than the expression in x on the RHS:"

I am not sure what to conclude from this
You can conclude that the point ##P## is above two lines and below one. The point ##Q## is above all three lines. And the origin is below two of the lines and above one.

Einstein44
A triangle is a convex set. If you have the three vertices, then the point (1,1) is inside the triangle if and only if it is a convex combination (all coefficients are non-negative and sum to 1) of the vertices.

Einstein44
Einstein44 said:
This is the solution:
Unfortunately I was not able to make sense of it, but perhaps it makes more sense now that I saw all the replies here.

The values of the linear functions which determine the sides of the triangle ##a(x,y) = 2x+y-2##, ##b(x,y)=2x-3y-6##, ##c(x,y)=x-y-1## opposite to vertices A, B, and C, correspondingly, take at these vertices signs +, −, −. At the point P they take signs +, −, −, and point Q signs +, +, −. Therefore P belongs to the interior of the triangle and Q does not
Let's assume from this that the rule is that ##+,-,-## indicates inside and ##+, +, -## indicates outside.

My point in post #3 is that if we rewrite ##c(x, y) = -x + y + 1##, which should be equivalent, then this changes the signs of point ##P## to ##+, -, +##.

There must be an added stipulation that we write the linear functions in a standard form with a positive coefficient for ##x##. This is why I suggested writing the lines in the standard ##y = mx + c## format. In any case, we must have a defined, standard format.

However, even then, does ##+, -, -## always indicate inside for all triangles, or are there some triangles where ##+, +, -## indicates inside?

Einstein44
Einstein44 said:
This is the solution:
Unfortunately I was not able to make sense of it, but perhaps it makes more sense now that I saw all the replies here.

The values of the linear functions which determine the sides of the triangle ##a(x,y) = 2x+y-2##, ##b(x,y)=2x-3y-6##, ##c(x,y)=x-y-1## opposite to vertices A, B, and C, correspondingly, take at these vertices signs +, −, −. At the point P they take signs +, −, −, and point Q signs +, +, −. Therefore P belongs to the interior of the triangle and Q does not
Note that you should have ##b(x, y) = 2x + 3y-6##.

Einstein44 and FactChecker
@Einstein44 I feel that this book is leading you astray, so I'll give you more of my analysis than I normally would for homework. Let's go back to my idea of using the format ##y = mx + c##.

Imagine a triangle with a horizontal base and area above the x-axis. It's clear that a point inside the triangle must be above the x-axis and below the other two lines. This would be a ##+, -, -## pattern.

If, however, we imagine the area below the x-axis, then the pattern would be ##-, +, +##.

What's clear is that the pattern of signs depends on the orientation of the triangle. We do not immediately know whether we are looking for ##+,+ -## or ##-, -, +##. It could be either.

I suggest, therefore, we also need to find a point definitely inside the triangle and test that. And see what pattern we are looking for. There are various ways to find one of those.

The book's method must suffer from the same problem that internal could be ##+, -, -## as in this case, but for a different triangle ##-, +, +## might indicate inside.

I'm also suspicious of a geometry teacher who asks you not to draw a sketch in this case, as all these algebraic ideas are essentially based on geometric ideas such as lines splitting planes into above and below. If the author did not sketch the problem, then I'm not suprised if they didn't fully grasp the possible solutions.

Einstein44
PeroK said:
@Einstein44 I feel that this book is leading you astray, so I'll give you more of my analysis than I normally would for homework. Let's go back to my idea of using the format ##y = mx + c##.

Imagine a triangle with a horizontal base and area above the x-axis. It's clear that a point inside the triangle must be above the x-axis and below the other two lines. This would be a ##+, -, -## pattern.

If, however, we imagine the area below the x-axis, then the pattern would be ##-, +, +##.

What's clear is that the pattern of signs depends on the orientation of the triangle. We do not immediately know whether we are looking for ##+,+ -## or ##-, -, +##. It could be either.

I suggest, therefore, we also need to find a point definitely inside the triangle and test that. And see what pattern we are looking for. There are various ways to find one of those.

The book's method must suffer from the same problem that internal could be ##+, -, -## as in this case, but for a different triangle ##-, +, +## might indicate inside.

I'm also suspicious of a geometry teacher who asks you not to draw a sketch in this case, as all these algebraic ideas are essentially based on geometric ideas such as lines splitting planes into above and below. If the author did not sketch the problem, then I'm not suprised if they didn't fully grasp the possible solutions.
Thanks very much for your input. I will try this problem again, this time with a better understanding!

The reason geometry is not allowed for this problem, is because this is not actually from a geometry class. This problem is from one of my modules on inequalities, sets and logic (to summarise).

PeroK said:
Note that you should have ##b(x, y) = 2x + 3y-6##.
Yes, you're right.

Einstein44 said:
The reason geometry is not allowed for this problem, is because this is not actually from a geometry class. This problem is from one of my modules on inequalities, sets and logic (to summarise).
That's BS in my opinion. Maths is maths and interior/exterior of a triangle is geometry. If the book is wrong, that justifies my point!

@PeroK sorry but you're wrong here. The exterior is not +,+,- the exterior is anything that doesn't match the single sign convention that defines the interior, so there are 7 sign patterns that all define the exterior. If you multiply both sides of the equation by -1, then you flip the sign of one of the defining inequalities, but that doesn't change anything. Whether any individual point satisfies the inequality is still the same.

Any polygon (or polytope in higher dimensions) is defined as the intersection of finitely many half spaces of the form ##<a,x> \leq b## for some ##a## and ##b##. If you have a > sign, multiplying both sides by -1 to turn it into a <, and absorbing the sign into your choice of a and b is standard.

@Einstein44 I'm happy to go into this in a bit more detail if it helps your understanding. Turning the equations into y=mx+b is especially not going to help your understanding when you start tackling higher dimensions.

Einstein44
Office_Shredder said:
@PeroK sorry but you're wrong here. The exterior is not +,+,- the exterior is anything that doesn't match the single sign convention that defines the interior, so there are 7 sign patterns that all define the exterior. If you multiply both sides of the equation by -1, then you flip the sign of one of the defining inequalities, but that doesn't change anything. Whether any individual point satisfies the inequality is still the same.
I never said all exterior points had the same pattern, only that ##+, +, -## indicates exterior points in some cases. Post #8 shows that point ##Q## has a ##+, +, +##. Which must be exterior.

I don't see how you can have one sign convention for all triangles simultaneously?

PeroK said:
I never said all exterior points had the same pattern, only that ##+, +, -## indicates exterior points in some cases. Post #8 shows that point ##Q## has a ##+, +, +##. Which must be exterior.

I don't see how you can have one sign convention for all triangles simultaneously?

The sign convention is a function of the equations that define the triangle. A triangle whose edges are ##y=1##,##x=1## and ##x+y=0## has interior ##y-1<0##, ##x-1<0##, ##x+y>0##.

Equivalently, ##-y+1##, ##-x+1>0##, ##x+y>0##. This gives a different sign convention. As does ##y-1<0##, ##-x+1>0##, and ##-x-y<0##. For any triangle, you can rewrite the inequalities to make any triple of signs the one that defines the interior. Each one is taking about the sign of different equationsthough

Take the triangle defined by:
$$a(x, y) = y, \ b(x, y) = x - y, \ c(x, y) = x + y - 1$$And consider the interior point ##(\frac 1 2, \frac 1 4)##. The pattern is: ##+, +, -##, which is opposite to the ##+, -, -## pattern that indicated the interior of the triangle in the question. So, by some method, we have to establish the sign convention for the triangle in question.

PeroK said:
Take the triangle defined by:
$$a(x, y) = y, \ b(x, y) = x - y, \ c(x, y) = x + y - 1$$And consider the interior point ##(\frac 1 2, \frac 1 4)##. The pattern is: ##+, +, -##, which is opposite to the ##+, -, -## pattern that indicated the interior of the triangle in the question. So, by some method, we have to establish the sign convention for the triangle in question.

The way you do it is by computing the vertices and checking each one against its opposite side.

Office_Shredder said:
@PeroK sorry but you're wrong here. The exterior is not +,+,- the exterior is anything that doesn't match the single sign convention that defines the interior, so there are 7 sign patterns that all define the exterior. If you multiply both sides of the equation by -1, then you flip the sign of one of the defining inequalities, but that doesn't change anything. Whether any individual point satisfies the inequality is still the same.

Any polygon (or polytope in higher dimensions) is defined as the intersection of finitely many half spaces of the form ##<a,x> \leq b## for some ##a## and ##b##. If you have a > sign, multiplying both sides by -1 to turn it into a <, and absorbing the sign into your choice of a and b is standard.

@Einstein44 I'm happy to go into this in a bit more detail if it helps your understanding. Turning the equations into y=mx+b is especially not going to help your understanding when you start tackling higher dimensions.
It was said: "so there are 7 sign patterns that all define the exterior". In fact, the exterior of a triangle is described by 6 areas. Three are each adjacent to a side of the triangle; these are inside of two of the lines, but outside the third. Three are each adjacent to a vertex; these are inside of one of the lines, but outside the other two. What this means is that of the 8 possible sign patterns, 1 indicates the interior, 6 indicate the exterior, and 1 is forbidden. Which I find interesting. The forbidden area would be on the outside of all three lines, but this is geometrically impossible.

Last edited:
Office_Shredder
FinBurger said:
It was said: "so there are 7 sign patterns that all define the exterior". In fact, the exterior of a triangle is described by 6 areas. Three are each adjacent to a side of the triangle; these are inside of two of the lines, but outside the third. Three are each adjacent to a vertex; these are inside of one of the lines, but outside the other two. What this means is that of the 8 possible sign patterns, 1 indicates the interior, 6 indicate the exterior, and 1 is forbidden. Which I find interesting. The forbidden area would be on the outside of all three lines, but this is geometrically impossible.

Ah, good point.

Einstein44 said:
Thanks very much for your input. I will try this problem again, this time with a better understanding!

The reason geometry is not allowed for this problem, is because this is not actually from a geometry class. This problem is from one of my modules on inequalities, sets and logic (to summarise).
I can't see how you could figure this out from sets and logic without having some geometric insight. I certainly could make no progress without a sketch. I think I understand the book's solution. We label the three lines ##A, B, C##, then the vertices opposite these lines ##V_A, V_B, V_C##.

Then, taking these in order: ##V_A## satifies the linear equations of lines ##B## and ##C## and we compute its value for the linear equation for line ##A##. We can call this function ##a## or ##a(x, y)##. We note whether its value is positive of negative. Then do the same for vertices ##V_B## and ##V_C##. The pattern we get in this case is ##+, -, -##. This is then the pattern we are looking for in the next step, which is to compute the three linear functions for the point in question. If we get the same pattern (in this case ##+, -, -##) it's an interior point. Otherwise, it's outside the triangle.

Unless this has been covered by your course (?) I don't see how you could figure this out for yourself.

FinBurger said:
It was said: "so there are 7 sign patterns that all define the exterior". In fact, the exterior of a triangle is described by 6 areas. Three are each adjacent to a side of the triangle; these are inside of two of the lines, but outside the third. Three are each adjacent to a vertex; these are inside of one of the lines, but outside the other two. What this means is that of the 8 possible sign patterns, 1 indicates the interior, 6 indicate the exterior, and 1 is forbidden. Which I find interesting. The forbidden area would be on the outside of all three lines, but this is geometrically impossible.
Neverthless, if we take my example:
$$a(x, y) = y, \ b(x, y) = x - y, \ c(x, y) = x + y - 1$$And consider the point ##(2, 1)##, we find that:
$$a(2, 1) = 1, \ b(2, 1) = 1, \ c(2, 1) = 2$$And, impossible or not, we have the ##+, +, +## signature!

PeroK said:
Neverthless, if we take my example:
$$a(x, y) = y, \ b(x, y) = x - y, \ c(x, y) = x + y - 1$$And consider the point ##(2, 1)##, we find that:
$$a(2, 1) = 1, \ b(2, 1) = 1, \ c(2, 1) = 2$$And, impossible or not, we have the ##+, +, +## signature!

I think you're missing this conceptually. The impossible sign pattern for this, if I did the math right, is -,-,+. Because y<0 from the first one, the second one makes x<y<0, then the third one is the sum of three negative numbers so can't be positive.

PeroK
Office_Shredder said:
I think you're missing this conceptually. The impossible sign pattern for this, if I did the math right, is -,-,+. Because y<0 from the first one, the second one makes x<y<0, then the third one is the sum of three negative numbers so can't be positive.
There's an 8th forbidden gluon state as well!

https://en.wikipedia.org/wiki/Gluon#Eight_colors

I guess a neat fact, the impossible combination is sign flipped in every spot from the interior, which I guess is another way to figure out which one the interior is. It's not hard to deduce in the original problem that -,+,+ is the impossible combination.