How to find the angle Theta from the Figure?

332 Views Asked by At

I have the following figure and want to find angle $\theta$ from the figure Find angle theta

I know the slope of the two lines can be obtained from :
\begin{align} m1 = \frac{Y2 - Y1} {X2 - X1} \end{align} Similarly, \begin{align} m2 = \frac{Y4 - Y3}{X4 - X3} \end{align}

Now i know that to find an angle between the given two lines is:
\begin{align} \theta = \tan^{-1}(\frac{m2 - m1}{1 + m1*m2}) \end{align} But i am not sure that the $\theta$ obtained is certainly the $\theta$ from my drawing.

Please help me out how I can resolve this.

2

There are 2 best solutions below

0
On BEST ANSWER

From dot product between 2 vectors:

$$a \cdot b = |a||b|cos\theta \\ cos\theta = \frac{a \cdot b}{|a||b|} $$

Building vectors from coordinates:

$$a = (X1-X2, Y1-Y2) \\ b = (X3-X4, Y3-Y4) $$

To sum up it all together:

$$cos\theta = \frac{(X1 - X2)(X3-X4) + (Y1-Y2)(Y3-Y4)}{\sqrt{(X1-X2)^2 + (Y1-Y2)^2}\sqrt{(X3-X4)^2 + (Y3-Y4)^2}}$$

0
On

Draw a horizontal line that intersects the vertex of $\theta,$ and let $\theta=\theta_1+\theta_2$ such that $\theta_1$ is below $\theta_2$ and both together are vertically opposite $\theta.$

By definition of gradient, $$\theta_1=-\arctan(m_1)$$ and $$\theta_2=\arctan(m_2).$$

Thus, $$\theta=\arctan(-m_1)+\arctan(m_2).$$

Since $\theta$ is acute, the arctangent addition formula applies: $$\theta=\arctan\frac{(-m_1)+(m_2)}{1-(-m_1)(m_2)}\\ =\arctan\frac{m_2-m_1}{1+m_1m_2}.$$