Support Vector Machines — Lecture series — Direction of a vector
In the previous post, I spoke about the magnitude of a vector and how to calculate this magnitude. In this post, I am going to talk a little bit more about the direction of a vector and how to obtain it.
Learning objective:
Understand how to obtain the direction of a given vector of certain magnitude.
Main question:
If you are given a vector of a certain magnitude, how would you obtain the appropraite direction of this vector? and does the magnitude of the vector have an effect on the direction of the vector?
Before we answer these questions I want you to take a look at the picture in Fig. 1 below:
In this image, you will see that there is a relationship between the angles that the vector makes with the axes (the x and y axis) and its direction.
For instance, if the vector is pointing in a direction that is closer to the y axis, it makes a smaller angle with that axis and a larger angle with the x axis and if it is pointing in a direction that is closer to the x axis, it makes a smaller angle to the x axis and a larger angle with the y axis.
Consider the image in Fig. 2 below:
We can find the direction of the vector in Fig. 2 by finding the cosine of the angles theta and alpha.
Why cosine?
The word ‘cosine’ is originates from the expression ‘complement of sine’ which basically means the complementary angle to the sine.
This complementary angle to the sine (cosine) gives us information on how far the vector has moved away from an axis. Hence to find the accurate direction of a vector, we need to know how far it has moved away from both the x axis and the y axis.
Hence for the vector in Fig. 2, its direction is going to be
(cos(alpha), cos(theta)) = ((4/u),(3/u))
Quite simple huh?
In the next post we will talking about the dot product of a vector