How to get angles of a triangle given three slopes from each line

339 Views Asked by At

I need a formula to tell whether a trigonometry corner has an obtuse angle or not, given slopes value of each line connecting every two points respectively. Assuming I have three points

| X(1,3). . . . .
| . . . . Y(5,2).
| . . Z(3,1). . .
|________________

So, their slopes will be

XY : -1/4
XZ : -1
YZ : 1/2

So from given slopes as variables, we'll be able to tell that point Z has an obtuse angle. The rest are acute of course. But I can't figure out how to do it. Thank you in advance.

4

There are 4 best solutions below

1
On

Take Origin = Point $Z$ , which means , we have to subtract the Co-ordinates from the other Points , to get :

$Z=(0,0)$
$X=(1-3,3-1)$
$Y=(5-3,2-1)$

We have to now get the Angle between the "vectors" $ZY$ & $ZX$


Standard Way is to calculate this with $\cos^{-1}([{X}\cdot{Y}]/[|X||Y|])$

Let the new "vectors" be $X=(x1,x2)$ & $Y=(y1,y2)$
Then the Angle between these two is $\cos^{-1}([x1y1+x2y2]/[\sqrt{x1^2+y1^2}\sqrt{x2^2+y2^2}])$

In this Method, we actually do not have to compute the $\cos^{-1}(\cdot)$ , we can simply check the SIGN of the argument : when it is Negative , we conclude that it is Obtuse & when it is Positive , we conclude that it is Acute.

More-over, we can avoid Squaring & Division because that will not change the SIGN.

We only have to calculate $[x1y1+x2y2]$ & Check the SIGN !

This Method is Very Efficient , requiring only Subtraction , Multiplication & Addition.

Check more on this with keywords : Dot Product & Normalization of vectors.


In given Example:
We get $\cos^{-1}([(-2)(+2)+(2)(1)]/[\sqrt{(-2)^2+(+2)^2}\sqrt{(+2)^2+(+1)^2}])$

$\cos^{-1}([-2]/[\sqrt{8}\sqrt{5}])$ , with Negative Argument , hence it has to be Obtuse Angle

$\cos^{-1}([-1]/[\sqrt{10}])=108$ (In Degrees)

Which is Indeed Obtuse Angle

3
On

Just note that the slope of a line in the coordinate plane equals $\tan{\alpha}$, where $\alpha$ is the angle between the line and the positive direction of the $x$-axis. So if we suppose that $\tan\alpha$, $\tan\beta$, and $\tan\gamma$ are given, then we can compute $\mid\tan(\alpha - \gamma)\mid$, $\mid\tan(\beta - \alpha)\mid$, and $\mid\tan(\gamma - \beta)\mid$ to find the absolute values of the tangent of the angles of our triangle. Note that $\tan(x - y) = \frac{\tan x - \tan y}{1 + \tan x.\tan y}$. So

If the given slopes are $m_1$, $m_2$, and $m_3$, let $f(x, y) = \frac{x - y}{1 + xy}$ and then compute \begin{align*} f(m_1, m_3), f(m_2, m_1) \text{ and } f(m_3, m_2). \end{align*} If the sign of one of them is different, then the triangle has an obtuse angle.

2
On

When co ordinates of $A,B,C$ or lengths $AB,BC,AC$ are given the the cosine rule is the best, keeping in mind that angle opposite the largest side the largest. But if three slopes ($m_1,m_2,m_3$ in any order) or equations of lines are given then one can use the following method. Find $$t_3 = \left|\frac{m_1-m_2}{1+m_1m_2}\right|$$ similarly $t_1,t_2.$ then check if $$t_1+t_2+t_3=t_1 t_2 t_3......(1)$$ is satisfied then three positive acute angles are $T_i=\tan^{-1} t_i$

If not then replace the the highest of them (let $t_2$) by $-t_2$ in both sides of (1). Then $$t_1-t_2+t_3=-t_1t_2t_3........(2)$$ will get satisfied meaning that the triangle is obtuse and its positive angles are: $T_1, \pi-\tan^{-1}t_2, T_3$, with $\pi-\tan^{-1}t_2$ being the obtuse angle.

EDIT:

In OP's question $m_1=-1/4, m_2=1/2,m_3=-1$ giving $t_1=3, t_2=3/5, t_3=6/7$. Check that $3+3/5+6/7 \ne \frac{54}{35}$ so it is not an acute angle triangle. Next. check that $-3+3/5+6/7= -\frac{54}{35}$ implyimg that it is an obtuse triangle and the obtuse angle is $(\pi-\tan^{-1} 3)$ which is nothing but $\cos^{-1} \frac{-1}{\sqrt{10}}=1.8925...rads=108.435...deg$ as obtained by @Prem below by cosine rule

0
On

It is similar to comparing degree or radiant values.

Let us imagine the triangle to be an intersection of three infinite lines. When we move the lines into into a common point, so that they only intersect in one single point, we can easily compare each slope with a 90° rotated slope since slope values are monotonous like values in radiant and degree. When we compare adjacent slope values, i.e. maximum value with middle value and middle value with minimum value, the positive difference represents the angle between them in the triangle (without considering the distortion factor here). Only when comparing the maximum and the minimum slope value the reversed difference needs to be used to represent the angle in the triangle.

But since the problem is not about computing angles, we only need to compare the middle and the minimum slope value against a sensible threshold value.

Let $s_{max} > s_{mid} > s_{min}$ be the three slope values. Then, this holds if and only if it is an acute triangle:

(F1) $$s_{max} > s_{mid} > s_{max,90°} > s_{min}$$ $$s_{mid,90°} \not\in [ s_{min} , s_{max} ]$$

where $s_{max,90°} = -1/s_{max}$ and $s_{mid,90°} = -1/s_{mid}$.

Obviously, there is a right angle, if either $s_{mid} = s_{max,90°}$ or $s_{min} = s_{max,90°}$ or $s_{min} = s_{mid,90°}$.

In consequence, you cannot have an accute triangle if $s_{max} \le 0$ or if $s_{min} \ge 0$. $s_{max,90°}$ must be between $s_{mid}$ and $s_{min}$, $s_{mid,90°}$ must be the biggest or smallest value.

Also note, that it does not matter for the angles how you move the lines around as long as they are not rotated individually. All triangles produced by arbitrarily moving these lines around have an equal set of enclosed angles.

Why?
If you have 3 parallel equidistant lines, you get 2 concruent infinitely long stripe areas in between them. If you add another 3 parallel equidistant lines into a different direction, you get 4 parallelograms in between these 6 lines. Now if you add another 3 parallel equidistant lines but exactly in the way so that they cut the parallelograms into triangles, you have 8 concruent triangles of which the inner 6 triangles are the triangles that you can get from moving around the lines (classes of triangles which are isomorphic except for the length units).

This justifies that the lines can be moved into one point as an explanation to read out the angles. It also explains visually why the sum of internal angles sum up to 180°.

Linear Algebra approach

Consider each slope to be a 2D vector. Only the $x$ value is interesting which is the slope value, the $y$ value is always 1. We can "pre-process" the vector space, mapping it into a standard basis so that $s_{max}' = \infty$ and $s_{max,90°} = 0$. This allows for quick comparisons replacing some few comparisons with arithmetic instructions. If any slope value is not finite, then the standard-basis is already established and pre-processing must be skipped. Also note that $-\infty$ should be treated as $\infty$ in this case.

Since we don't care for lengths, our pre-processing transformation doesn't need to be an orthogonal matrix, its a scaled rotation.

This rotation matrix only needs to compute the $x$ value of the result because the $y$ does carry quantitative but not qualitative information about the angle.

The required transformation is the inverse matrix of $$\mathbf{M} = \left[\array{s_{max,1} & s_{max,90°,1} \\ s_{max,2} & s_{max, 90°, 2}}\right] = \left[\array{s_{max} & -1 \\ 1 & s_{max}}\right]$$

For the computation of the inverse, the determinant can be ignored because it's just a scaling factor. The inverse therefore is $f_{\mathbf{M}^{-1}}(s) = s_{max} \cdot s + 1$ or $f_{\mathbf{M}^{-1}}(s) = s$ if the preprocessing is skipped.

The pre-processing transformation maps the $s_{max}$ vector to x-axis and it's 90° rotated vector to the y-axis.

Then the triangle has solely acute angles if and only if

(F2) $$f_{\mathbf{M}^{-1}}(s_{mid}) > 0 > f_{\mathbf{M}^{-1}}(s_{min})$$ $$s_{mid,90°} \not\in [ s_{min} , s_{max} ]$$

where $s_{mid,90°} = -1/s_{mid}$.

We only need to compare against 0 because in the standard basis, x = 0 represents the 90° rotate maximum slope value. The formula cannot be satisfied when $\mathbf{M}$ rotates vectors by $\ge 90°$. After the transformation, the $y$ value monotonously decreases for increasing slope values so that the monotonicity of the actual slope values $x/y$ still is preserved. A rotation below 90° will not change the qualitative order of vectors (previously sorted by $x$-axis when each had the same $y$ value) and therefore F2 should be satisfied if and only if F1 is satisfied.