Angle between 3D vectors

113 Views Asked by At

I was given this problem and came up with an answer but I'm not sure I did everything right.

You are on the ground standing and facing a corporate building and with a blue light at the top. $30°$ to your left is a monument with a yellow light at its height. Given that the corporate building is $50$ meters from you and $45$ meters high, and the monument is 30 meters away and $35$ meters high, from your point of view, what is the angle between the blue and yellow lights?

Now, assuming I'm standing at $[0,0,0]$, I gave corporate building a z coordinate of 0m (making it $[50,45,0]$ and monument a z of $15m$ $[30,35,15]$. I did the dot product between the two and divided that by the product of their magnitudes. What I came up with is $19.4°$ (I checked this with an online angle calculator and verified it.). I figure if anything, my answer should have been a little more than $30°$. Does my answer make sense or did I tackle this problem the wrong way?

1

There are 1 best solutions below

1
On

Your description suggest that the $x$ and $z$ coordinate form the floor and the $y$ coordinate represents the height.

I cannot see where you take the $z=15$ for the monument from, and think this is what is wrong. Lets imagine you are at $[0,0,0]$ as you said, and both objects are in the same place. Then the objects would have the coordinates $[50,45,0]$ and $[30,35,0]$. Now it says the angle (as seen from you at $[0,0,0]$) between the objects is $30°$ and this is the angle 'on the floor' (in the $x-z$-plane). What we now have to do in order to get the two correct vectors is rotating one object by $30°$ around your position.

Lets say we rotate the monument by $\alpha = 30°$, then the coordinates of the monument becomes $[30\cos(\alpha),35,30\sin(\alpha)]$.

enter image description here

PS: Sorry for the crappy drawing.