Find the angle that creating with Y axis in degrees

13.7k Views Asked by At

I want to find the Q angle that creating with Y axis in degrees using vectors

enter image description here

2

There are 2 best solutions below

0
On

I don't know how to do with vectors. A simple way is to use $$\tan(90-\theta)=\dfrac{y_2-y_1}{x_2-x_1}$$
Or
$$\tan\theta=\dfrac{x_2-x_1}{y_2-y_1}$$
Take the solution of the above equation s.t. $\theta<\pi/2.$

0
On

Assume the two points are distinct, otherwise the problem is ill-posed.

Let $Y_1 = {\rm max}(y_1, y_2)$ and $Y_2 = {\rm min}(y_1, y_2)$. Then the angle between the line and the $y$-axis is $$\cos^{-1}\!\left({Y_1 - Y_2\over\sqrt{(x_1-x_2)^2 +(Y_1-Y_2)^2} }\right)\,.$$

If there is some requirement to use vectors, then the above expression can be derived vectorially as follows. Letting ${\bf r}_1 = (x_1, Y_1)$ and ${\bf r}_2 = (x_2, Y_2)$, define the unit vector $\hat{\bf r} = ({\bf r}_1 - {\bf r}_2)/||{\bf r}_1-{\bf r}_2||$. The unit vector $\hat{\bf y}$ defining the direction of the $y$-axis is $\hat{\bf y} = (0, 1)$. Now using the dot product, $\cos\theta = \hat{\bf y}\cdot \hat{\bf r}$. Working with components leads to the explicit expression above.