What are Vectors and why we need them !?
Good question, vectors seem so deceptively simple when we initially meet them, but then when we dig deeper they tend to become confusing. I think the basic reason for it is that Vectors are introduced in school as pure mathematical "machination", rather than approaching them in more intuitive practical way.
In this article I would like to concentrate more on the practical matter about vectors, which is often unexplored, rather than purely mathematical.
Before Vectors we had Scalars.
Scalars hold single value, but often there is physical quantities that can not be represented by single value or if we can then managing the math becomes tedious to say the least.
Think about velocity, acceleration, position in 2 dimensions or 3 dimensions .....
The fundamental idea behind vectors from practical standpoint is that they can hold/represent multiple values, but still be expressed with single symbol in formulas and calculations.
The big win from this is that we can use ordinary arithmetic and algebra for the most part and still do correct computation for much more complex physical phenomenas. Why throw used and tried practices if we can reuse.
Let me repeat this because I think it is the most important idea behind Vectors.... we can use the same algebraic manipulations we learned in high school to do vector arithmetic's. In most cases we treat the vector as a "scalar-black-box" and when we don't there is pretty good common sense reason for that, mostly expressing new ideas which are not available to us in arithmetic's. So of course if we can't represent those new ideas in scalar arithmetic, then we will invent new conventions.
We represent vectors in Cartesian coordinate system by their x and y coordinates (2D). The assumption is that the vector starts at coordinate [0,0] and end at [x,y] like in the image beside. To calculate the magnitude of a vector we use the Pythagorean theorem.
`v^2 = x^2 + y^2` so : `|vec v| = sqrt(x^2+y^2)` The vertical bars around the vector name signifies magnitude.
Then there is the postulate that a sum of two vectors is a new vector that starts from the beginning of the first vector and ends at the end of the second vector. In our case this is `vec v` in the diagram. Here is something interesting, vectors if transposed are the same, so `vec y = vec y_1`. Then if we apply the rule that we just stated about summing vectors `vec v = vec x + vec y_1 = vec x + vec y`.
That is good pattern but we can do better. When we measure things in the real life we normally say something is so and so meters/ft long. What we are really assuming is that there is somewhere some ideal meter/ft which is "set in stone" with a value of 1 (one) and we use this ideal-meter to measure and compare things.
So then you probably guessed that we will have something similar with Vectors, yep! we have such thing and it is called unit or normalized vector. Now that we have this ideal-measuring-stick device we can say that, vector is equal to the magnitude multiplied by the unit-vector :
`vec x = |vec x| * hat x` the `hat x` thingy here signifies the unit vector and `|x|` is the magnitude i.e. the vector is equal to (magnitude * unit-vector).
The next thing that comes to mind now is that we can represent our original `vec v` as a sum of multiplications of magnitudes and unit vectors, here is how :
Variation 1 `vec v = |vec x| * hat x + |vec y| * hat y` In many books and tutorials instead of putting the arrow over the top over the vector symbol, bold typeface is used, like this : Variation 2 `bbv = |bbx| * hat x + |bby| * hat y` we wont because it is confusing. Other way of representing vectors via unit vectors are the following : Variation 3 `bbv = x*bbi+y*bbj` Example : `bbv_1 + bbv_2 = (x_1 * bbi + y_1*bbj) + (x_2*bbi + y_2*bbj) = (x_1+x_2) * bbi + (y_1 + y_2) * bbj` here `bbi` and `bbj` are the two unit vectors. See this time the "name" tells us which are the unit-vectors, not the boldness or hat. Another way is using pairs of values like this : Variation 4 `bbv = (x,y)` Example : `bbv_1 + bbv_2 = (x_1,y_1) + (x_2,y_2) = (x_1+x_2, y_1+y_2) ` One of the reasons for the confusion with vectors are those different way of representation. I hate it it sucks big time. ( :) can I use "it it" like this ?) Keep in mind that there are variations on the above variations.
Why would we complicate our lives like this ! I'm talking about using unit-vectors not the complications of the representations :).
The benefit is that we can deconstruct the original vector into two scalars. We also can see that unit-vectors associated with every of the scalars are perpendicular to each other. The more general term used is that the vectors are orthogonal to each other i.e. mutually-independent, non-overlapping.
I think now you can appreciate the idea which is : we can represent any vector via 2 mutually independent variables (three for 3D, etc).
Let's list the three important concepts I wanted to convey about vectors : As I said I will skip the other common mathematical manipulation like subtraction, multiplication by scalar..etc.. there are plenty of tutorials on Internet about those. What I want to concentrate your attention to are new, as I promised purely Vector operations and their genesis and purpose.
I'm talking about :
- dot and cross product