Vector components

Jaime E. Villate. Topics of Mechanics,
University of Porto, Portugal, 2025.

2.1 Unit vectors

A unit vector is a vector with magnitude equal to 1. Thus, what distinguishes different unit vectors is their direction and any possible direction in space can be associated with a unit vector. If we divide a vector A by its magnitude, the result is a unit vector, in the direction of A, which we will dub as A^, with a circumflex accent rather than an arrow, to distinguish it from A:

A^=AA
(2.1)

Vector A is then characterized by a positive scalar A, its magnitude, and a unit vector A^ which defines its direction (see figure 2.1). The vector is the product of its magnitude and its unit vector: A=AA^.

Figure 2.1: Unit vector A^ in the direction of a vector A.

2.2 Vectors on a plane

If we choose a particular direction on the plane and call the unit vector in that direction ı^, any other unit vectors A^, B^, etc. can be defined with just one number, the angle between those unit vectors and ı^. In Figure 2.2, the unit vector A^ makes an angle α with vector ı^, in the counterclockwise direction. Rotating an angle α from the direction of ı^ in the clockwise direction leads to another direction different from A^; to distinguish those two directions, we give a positive sign to one of them and a negative sign to the other. The unit vector ȷ^, perpendicular to ı^ defines the direction in which we consider the angle with ı^ positive. The angle β of unit vector B^ in figure 2.2 is then negative.

Figure 2.2: Unit vectors and their relation to unit vectors i and ȷ^. A.

The directions of the two unit vectors ı^ and ȷ^ are usually called the x and y directions. Notice that every direction in space can be defined by a positive or a negative angle. In Figure 2.3 we show the direction +30°, which is the same as the -330° direction, and the direction −120°, which is the same as the direction 240°. Here we chose to use values between −180° and 180° (between π and π radians).

Figure 2.3: In an xy axes system, all directions can be divided into 4 quadrants.

Whatever value you choose for a direction with angle θ, cosθ and sinθ will give the correct values of the projections of a unit vector in that direction along the x and y axes. The projection along the x axis, cosθ, will be positive if the direction is in the first or fourth quadrants (see Figure 2.3), or negative if it is in the second or third quadrants. The projection along the y axis, sinθ, is positive in the first and second quadrants and negative in the third and fourth quadrants. Any unit vector C^ can then be written as,

C^=cosθı^+sinθȷ^
(2.2)

where θ is the angle that C^ does with the x axis. Vector C, which is the product of its magnitude C times the unit vector C^, can be written as the sum of two vectors Cx and Cy, in the directions of ı^ and ȷ^:

C=Cx+Cy=Cxı^+Cyȷ^
(2.3)

where Cx and Cy are called rectangular component vectors and the rectangular components of the vector are

Cx=Ccosθ Cy=Csinθ
(2.4)

Conversely, given the rectangular components Cx and Cy of a vector, we can find its magnitude and direction through,

C=Cx2+Cy2 tanθ=CyCx
(2.5)

But since tanθ=tan(θ+π), there will be directions in the first and third quadrants with the same value of tanθ and the same for directions in the second and fourth quadrants. The value of θ can then be computed as:

θ={arctan(CyCx)+πx0,x0arctan(CyCx)+πx<0,y0arctan(CyCx)πx<0,y<0
(2.6)

Computer programs usually include an extra function to compute inverse tangents given two parameters, the two rectangular components, returning a result in agreement with equation 2.6.

2.2.1 Scalar multiplication

Using the associative property of scalar multiplication, the product of scalar k times a vector A=Axı^+Ayȷ^ is equal to,

kA=kAxı^+kAyȷ^
(2.7)

Thus, each rectangular component is multiplied by the scalar.

2.2.2 Vector addition in rectangular components

In rectangular components, the sum of A and B is,

A+B=Axı^+Ayȷ^+Bxı^+Byȷ^

Using the commutative property of vector addition and the distributive law of scalar multiplication, we arrive at the result:

A+B=(Ax+Bx)ı^+(Ay+By)ȷ^
(2.8)

Namely, each rectangular component of the sum is equal to the sum of the corresponding components of vectors A and B. Figure 2.4 shows the vectors (in red), their component vectors (in blue), and the sum of the vectors (in red). The same result is obtained by adding the vectors or by adding their component vectors instead.

Figure 2.4: The sum of two vectors is equal to the sum of their rectangular component vectors.
Example 2.1

A plane moves 580 km in direction 56° north of the east during its first hour of flight and 740 km in direction 28° south of the west during its second hour of flight. Find the total displacement of the plane during those two hours, giving its magnitude and direction.

Solution: The following diagram shows the plane's displacements A and B during the first and the second hour, using x axis in the east direction and y axis in the north direction.

The rectangular components of those vectors, in km, are then,

Ax=580cos56=324.33  Ay=580sin56=480.84
Bx=740cos(152)=653.38  By=740sin(152)=347.41

The total displacement is the sum of the two vectors:

A+B=(324.33653.38)ı^+(480.84347.41)ȷ^ =329.0ı^+133.4ȷ^

The magnitude of that total displacement is,

329.02+133.42=355km

And the angle it makes with the east direction is,

arctan(133.4329.0)+180=158

Namely, the total displacement was 355 km in the direction 22° north of the west.

2.2.3 Dot product in rectangular components

To derive the expression of the dot product in rectangular components, we first notice that since both ı^ and ȷ^ have magnitude equal to 1 and they are perpendicular to each other, we then have,

ı^·ı^=1ȷ^·ȷ^=1ı^·ȷ^=0
(2.9)

We can then apply the distributive law for the dot product:

A·B=(Axı^+Ayȷ^)·(Bxı^+Byȷ^)
=AxBxı^·ı^+AxByı^·ȷ^+AyBxȷ^·ı^+AyByȷ^·ȷ^

This leads us to the result,

A·B=AxBx+AyBy
(2.10)

2.2.4 Cross product in rectangular components

The cross product of any vector with itself is zero and the cross product of two perpendicular vectors has magnitude 1 and is perpendicular to those vectors. Therefore, we have the following properties for the rectangular unit vectors:

ı^×ı^=0ȷ^×ȷ^=0ı^×ȷ^=k^
(2.11)

Where k^ is the unit vector perpendicular to the plane xy, in the direction of the right-hand rule from ı^ to ȷ^ (see figure 2.5).

Figure 2.5: Vectors A and B on the plane of ı^ and ȷ^ whose perpendicular unit-vector is k^.

In rectangular coordinates, the cross product between vectors A and B is,

A×B=(Axı^+Ayȷ^)×(Bxı^+Byȷ^)
=AxBxı^×ı^+AxByı^×ȷ^+AyBxȷ^×ı^+AyByȷ^×ȷ^

And the result is:

A×B=(AxByAyBx)k^
(2.12)

Therefore, the magnitude of the cross product between the two vectors can be written as the absolute value of a determinant where the first row is the rectangular components of A and the second row us the rectangular components of B:

|A×B|=absolute value of |AxAyBxBy|
(2.13)

If the determinant above is positive, the cross product A×B is in the direction k^ and if it is negative, the cross product is in the direction k^.

Example 2.2

Find the area of the triangle PQR and the distance from point P to the side QR.

Solution: The two vectors PQ and PR on the sides of the triangle form a parallelogram whose area is twice the area of the triangle. Therefore, the area of the triangle is equal to one-half of the magnitude of the cross product between PQ and PR. The components of those vectors can be read directly from the figure, leading to the following result:

Area=12|PQ×PR|=12|30.543|=5.5

The distance from P to the side QR is the height of the triangle, when QR is considered its base. Thus, that distance is equal to twice the area of the triangle, divided by the length of side QR:

d=2×5.5QR·QR=2×5.512+3.52=3.02

2.3 Vectors in space

A vector A in space can be written as the sum of three component vectors Ax, Ay and Az, in the directions of the unit vectors ı^, ȷ^ and k^ (figure 2.6).

Figure 2.6: Rectangular components of a vector in space.

Figure 2.6 shows the three rectangular component vectors; the three rectangular components Ax, Ay and Az are the projections of the vector along the x, y and z axis and we have,

Ax=AcosθxAy=AcosθyAz=Acosθz
(2.14)

Where θx, θy, and θz, called director cosines, are the angles that the vector does with each of the three axes. Notice that the director cosines are the rectangular components of the unit vector A^

A^=cosθxı^+cosθyȷ^+cosθzk^
(2.15)

And, since its magnitude is one,

cos2θx+cos2θy+cos2θz=1
(2.16)

Namely, we only need to know two of the angles θx, θy and θz to know the direction of A. It is straightforward to generalize the expressions for the sum and products of vectors on a plane to the case of vectors in space:

pA=pAxı^+pAyȷ^+pAzk^
(2.17)
A+B=(Ax+Bx)ı^ +(Ay+By)ȷ^ +(Az+Bz)k^
(2.18)
A·B=AxBx+AyBy+AzBz
(2.19)
A×B=|ı^ȷ^k^AxAyAzBxByBz|
(2.20)

2.4 Position

The position of a point P in space can also be given as three coordinates (x, y, z), which are the distances from the point to the three planes yz, xz, and xy, as shown in figure 2.7. One can think of those three planes as two walls and the floor in a room.

Figure 2.7: Position of a point in space.

There is a difference between the rectangular coordinates (x, y, z) of a point, and the rectangular components (Ax, Ay, Az) of a vector. The coordinates depend on the position of the origin (O in Figure 2.7); a different choice of origin gives different coordinates for the same point. On the other hand, the rectangular components of a vector depend on the directions chosen for the three axes, but not on the position of the origin.

The position of a point with coordinates (x, y, z) can also be represented by a vector r, called position vector, defined as:

r=xı^+yȷ^+zk^
(2.21)

Figure 2.8 shows the position vector of point P, which is a vector from the origin O to point P. We have used a lowercase letter and a different color for the position vector because it is not a real vector. For instance, the product of a scalar by a position vector or the sum of two position vectors has no physical meaning because it depends on the choice of the origin.

Figure 2.8: Position vector rP of a point P.

However, the subtraction of two position vectors does have a physical meaning, which is the displacement vector from one point to another (figure 2.9), independent of the choice of the origin.

Figure 2.9: Position vectors of two points and displacement between them.

The displacement A from point P to point Q is equal to the position vector of Q minus the position vector o P:

A=PQ=rQrR
(2.22)

Which can also be written as rQ=rP+PQ, showing that a position vector plus a displacement vector leads to another position vector. Another meaningful operation among position vectors is a weighted sum of position vectors, with the sum of all weights equal to one:

r=i=1nkirik1++kn=1
(2.23)

Which is a valid position vector. If the constants ki are all positive, r is the position of the center of mass of a system of particles of masses mi, in the positions ri, and ki is the mass mi divided by the total mass. Another important case is when the vectors ri are on a plane and all constants ki are equal; in that case, equation (2.23) gives the position of the centroid of the polygon with vertices in ri.

Example 2.3

The three vertices of a triangle have the following rectangular coordinates:

P=(2,1,3)Q=(1,4,2)S=(3,1,2)

Find: (a) The lengths of its sides. (b) The 3 angles. (c) The area of the triangle. (d) A unit vector perpendicular to the triangle.

Solution: We can define the sides and the angles as in the following figure:

The position vectors of points P, Q, and A are,

rP=2ı^ȷ^+3k^rQ=ı^4ȷ^2k^rS=3ı^+ȷ^+2k^

And vectors A, B and C are then,

A=rQrP=ı^+5ȷ^5k^
B=rSrQ=2ı^3ȷ^+4k^
C=rPrS=ı^2ȷ^+k^

Before proceeding, notice that A+B+C is equal to 0, as it should be.

(a) The sides of the triangle are the magnitudes of the three vectors:

A=A·A=1+25+25=7.1414
B=B·B=4+9+16=5.3852
C=C·C=1+4+1=2.4495

(b) The cosine of each angle is equal to the scalar product of the two vectors on the sides of the angle, divided by their magnitudes. Notice that we must invert the direction of some of the vectors to get the right angle:

cosα=(B)·CB×C=85.3852×2.4495

cosβ=A·(C)A×C=147.1414×2.4495

cosθ=(A)·BA×B=377.1414×5.3852

And the inverse cosines give the three angles α=127.3, β=36.9 and θ=15.8 (the results with three decimal digits were 127.335, 36.839, and 15.826, which we rounded to 1 decimal digit as shown, to ensure that their sum is 180°).

(c) The area of the triangle could be found with two sides and the angle between them or from the cross product of two of the vectors on the sides, for instance,

(A)×B=|ı^ȷ^k^155234|=5ı^+6ȷ^+7k^

And the area is half of the magnitude of that vector:

Area=1225+36+49=5.244

(d) The vector (A)×B, which we computed above, is perpendicular to the triangle. To get a perpendicular unit vector, we divide (A)×B by its magnitude, 110, and the result is:

0.4767ı^+0.5721ȷ^+0.6674k^

Problems

  1. A methane molecule (CH4) is composed of a carbon atom bound to 4 hydrogen atoms. The hydrogen atoms arrange themselves so that they are as far apart as possible in a symmetric arrangement, as shown in the following figure.
    1. Prove that if the carbon atom is placed at the origin, the four hydrogen atoms could be placed in the directions:
      ı^+ȷ^+k^ı^ȷ^k^ ı^+ȷ^k^ı^ȷ^+k^.
    2. Knowing that the distance between the carbon atom and any of the hydrogen atoms is 108.70 pm, find the distance between any two hydrogen atoms.
    3. Find the angle between any two carbon-hydrogen bonds.
    (b) 177.5 pm. (c) 109.47°. (a) Show that the angle between any two of the 4 vectors given is the same, by showing that they all have the same magnitude and their dot product gives the same value. (b) Divide two of the vectors given by their magnitude to find unit vectors in their direction; multiply them by 108.70 pm to obtain two vectors from the carbon atom to two hydrogen atoms; subtract those two vectors and the magnitude of the result will give the distance between those two hydrogen atoms. (c) The angle is the inverse cosine of the dot product of two of the vectors given, divided by their magnitudes.
  2. A missile is following a straight-line trajectory. It is initially detected in a radar station at position 87.188ı^29.064ȷ^+232.494k^ (distances in km), and sometime later it is observed at 43.595ı^14.533ȷ^+116.247k^.
    1. Prove that the missile is approaching the radar station.
    2. Find the closest distance from the radar station that the missile will reach if it continues in its straight-line trajectory.
    (b) 3 m. (a) Show that the magnitude of the second position vector is smaller than the magnitude of the first position vector, which shows that the missile is approaching the radar. (b) The difference of the two position vectors, divided by its magnitude gives the unit vector in the direction of the trajectory. The closest distance is the distance from the radar to the trajectory, which is the magnitude of the cross product between that unit vector and either one of the position vectors given.