Math - Vector Direction

In this lecture we looked at how to express the direction of a vector using angles, which will come in very handy when we start looking at rotations.

We looked at how to use a single angle to describe the direction of a 2D vector but when it comes to 3D we had two options.

Which method did you prefer?

Around 1:00 in the video @garypettie used the Atan function to get the angle , but the length of the hypotenuse(vector’s magnitude) is also available. My question is how do I know I’m supposed to use the Atan function ? :dizzy_face:

Great question @Alvin_Woodly!
When we’re dealing with vectors, we are given the x- and y- coordinates. We can view these coordinates as the adjacent and opposite sides of a triangle. Therefore, the quickest way to find the angle is to use the formula θ = atan(y/x).

In the video example , we were lucky with out numbers and didn’t have to do much to figure out that the hypotenuse would be 5 (Pythagorean triples are awesome!). However, working this out will usually involve additional calculation steps and should therefore be avoided if you can help it.

That said, if you are already using the distance between two points (the hypotenuse) for something else, then there’s certainly no harm in using either of your other two basic trig functions to work out the angle, since the additional calculation is being performed anyway.

It really just comes down to what information you have and then using the formula that involves the least amount of steps to get to the answer you’re looking for.

Privacy & Terms