Vectors and Projection : Geometrically !!!

The Simplest Example of a Vector is x = [1 ,2 ]. It is a 2 element or 2-dimensional vector. The 2 elements can be taken as x and y, they are exactly the cartesian co-ordinates in a 2-d space. The vector corresponds to the point in that space.

Vectors with n elements will represent points in d-dimensional space.

Let's Visualize vector by plotting. We would be using python matpolitlib for plotting.





The following pictures show the vector in a 2d space.  We can plot as many vectors in a 2d space with 2 elements, and there would be as many vectors in vector space. The Linear combination of these vectors falls on the same space, that is what we simply call vector space.

Projection of Vector onto another Vector.

In the following picture, what would be the projection of the Vector (Red) on Vector(blue) ?
Visualize in your mind first.




first, let's recall the formula of projection.



Projection of Vector a On b




The upper partis just the dot product and the lower part is the magnitude of the vector onto which a vector is to be projected.

In the following figure, I want to project the red vector to the blue vector, which means I want to draw a perpendicular from red to blue and want to see the size of the dropped perpendicular from the origin along with blue.

The projection of a vector a on vector b is a scalar quantity. The formula and calculation is shown below.








 So, but we now want to plot and check how it behaves geometrically.
Wait! that's a scalar quantity, how would you plot it?

Well, what we need is the direction too for plotting, the magnitude i.e projection , we already computed, the direction of projection of the vector a on vector b is the same direction on the b, and to find the direction of the vector on any vector we need is the unit vector along that direction, which is simply computed using the formula below and plotted as in the figure.






Code - https://github.com/prajinkhadka/Linear-Algebra




Comments