Basics of Vectors and Coordinate Space

Vineeth S Subramanyam
6 min readFeb 7, 2021

Vectors and Coordinate spaces are topics often overlooked as they seem very self explanatory, and easy to understand, from a point of view of mathematical formulas. However, unless we understand intuitively the impact of various vector operations on coordinate spaces, it becomes a lot more difficult to grasp concepts like Linear Transformations or Jacobians. In this post, I hope to lay the ground with the basics of vectors, coordinate spaces and projections, and build on these concepts in future posts.

Figure 1: Basic 2D coordinate system

The figure above is the basic 2 Dimensional coordinate system we are used to seeing. The X axis is horizontal, and gets more postive to the right, and more negative as we move left. Similarly the Y axis increases upwards, and decreases downwards.

Figure 2: Description of a point

The point shown in the figure is represented as (1, 1), which means if we move 1 unit along the +X axis, and then move +1 unit along the Y axis, we would reach (1, 1).

Vectors

Figure 3: Representing a Vector
  • A vector can be thought of as any quantity that has a magnitude, and a direction. In the figure above, the orange line pointing towards (1,1) corresponds to a vector.
  • Representing a vector as a point: Using the example from the figure above, we could mathematically represent the vector above as:
    v = [1, 1]. The [1,1] corresponds to the point at which the vector ends. To find the direction of this vector v, we simply draw a line from the origin
    (0, 0) to this point (1, 1). The direction in which this line points, corresponds to the direction of our vector v.
  • Representing a vector with respect to the coordinate space:
    We can also represent a vector with respect to the axes in equation form. We can represent this vector also as v = 1x + 1y , which means we move 1 unit along the X axis, followed by 1 unit along Y axis.

Magnitude / Length of a Vector:

  • The magnitude of a vector is essencially its length. To find the length of a vector we need to know its starting point(x1, y1) and its ending point
    (x2, y2). Mathematically it is represented by the modulus operator |v| .
Figure 4: Lenth of a Vector
  • Going by the vector in Figure 3, the magnitude of the vector would be:
Figure 5: Magnitude of Vector in Figure 3
  • Our (x1,y1) in this case are (0, 0), because that is the starting point of the vector, and (x2,y2) is (1,1), because that is the ending point.

Unit Vectors:

  • The term unit vector is used to define a vector that has unit length; i.e length=1.
Figure 6: Defining a new vector of length 2.12
  • If we have a vector, for example (1.5, 1.5), and we calcluate its length using the formula from Figure 4, we get a length of 2.12 .
  • Now if we wish to convert this same vector to a unit vector, all we need to do, is make sure its length is 1. The way we would go about reducing the length of this vector is simply by shrinking it, till it has a length of 1.
Figure 7: Converting a vector to a unit vector
  • Mathematically we achieve this by dividing the original vector by its length. In this case, we would divide the vector represented by the point (1.5,1.5) by its length 2.12.
Figure 8: Unit vector for figure 6
  • This results in a new vector that points in the same direction as the original vector, but instead has a length of 1. Unit vectors are often used just as a representation of direction.

Projection of Vectors

Figure 9: Projection of a vector
  • The projection of a vector onto another can be understood as the shadow cast from one vector onto another. From the figure above, it can be thought of as, how would the shadow of Vector 2 look if the person was to look down on Vector 1. It is also important to note that we must look down perpendicular to Vector 1 to view the projection.
Figure 10: Projected vector
  • The projection of Vector 2 onto Vector 1 would look like the yellow arrow from the figure above.
  • It is clear to see that if we project Vector 2 onto Vector 1, it points in the same direction as Vector 1, but has a different length.
  • Now to mathematically quantify this projection, we use trignometry
Figure 11: Trignometry for projecton
Figure 12: Formula of cosine
  • From the figure above, the adjacent of the triangle, and the projected Vector 2 represent the same yellow line. The hypotenuse of the triangle is the Vector 2, and the opposite is the perpendicular from Vector 2 drawn onto Vector 1.
Figure 13: Cosine of theta represented in terms of vectors
  • The cosine of the angle can be written in terms of the lengths of each vector.
Figure 14: Length of projected vector 2
  • The length of projected vector 2 can be written in terms of the length of the actual vector 2 and the cosine of the angle between vector 1 and vector 2.
  • Now we already have the length of the projected vector 2, and only need its direction in order to represent it individually as a new vector. For this, we make use of vector 1, since it also points in the same direction as the projection. As i mentioned before, unit vectors often are used to just represent a direction, as they have a length=1.
Figure 15: Unit vector 1
  • The unit vector 1 is essetially a representation of the direction of
    vector 1. Now all we need to do in order to get the projected vector 2, is to scale this unit vector 1 to the length of the projected vector 2 that we calculated earlier. (For example if the projected vector 2 has a length = 0.7, and the unit vector has a length = 1, multiplying the unit vector by this length of 0.7 has the effect of simply scaling its length in the same direction.)
Figure 16: Projected vector 2 calculated with respect to unit vector 1

Points to note:

  • The cos(theta) that we calculated in Figure 13 represents the angle between the 2 vectors.
  • The formula for projection can be written differently to include the dot product. The definition using the dot product is more generalized, as it does not require us knowing the angle between the vectors in advance. I will go over the dot product in the next post.
Figure 17: Column form of a vector
  • Vectors are generally represented in column form rather than
    row form [1,1]. In the column form, each row represents each axis. (For example row 1 represents a length of 1 in the x direction, and column 2 represents a length of 1 in the y direction).

--

--