# Vectors

**Vectors** are used in engineering analysis to
represent quantities that have both a **magnitude** and a
**direction**. Many engineering quantities, such as forces,
displacements, velocities, and accelerations, will need to be
represented as vectors for analysis. Vector quantities contrast with
**scalar** values (such as mass and speed) which have a
magnitude but no direction.

## Vector Representation:

In terms of representing vectors, there are two forms we can use to represent vectors. These two forms are:

**Magnitude and Direction Form**: Where the magnitude is
given as a single quantity and the direction is given as an angle.

**Component Form**: Where the magnitude in the
horizontal and vertical directions are given. By having the two
components of the magnitude we can determine both the magnitude and the
direction of the vector.

## Converting Between Forms in 2D

For our analysis, we will often find it advantageous to have the vectors in one form or the other, and will therefore need to convert the vector from a magnitude and direction to component form or vice versa. To do this we will use right triangles and trigonometry.

### Going from a magnitude and direction to component form

To go from a magnitude and direction to component form we will first draw a right triangle with the hypotenuse being the original vector. The horizontal arm of the triangle will then be the x component of the vector while the vertical arm is the y component of the vector. If we know the angle of the vector with respect to either horizontal or vertical, we can use the sine and cosine relationship to find the x and y components.

It is important to remember that how we measure the angle will affect the sine and cosine relationships. Multiplying the magnitude by the sine will always give us the opposite leg and multiplying the magnitude by the cosine will always give us the adjacent leg.

### Going from component form to a magnitude and direction

To find the magnitude and the direction of a vector using components, we will use the same process in reverse. We will draw the components as the legs of a right triangle, where the hypotenuse of the triangle shows the magnitude and direction of the vector.

To find the magnitude of the vector we will use the Pythagorean theorem, taking the square root of the sum of the squares of each component. To find the angle, we can easily use the inverse tangent function, relating the opposite and adjacent legs of our right triangle.

If we know the magnitude of the hypotenuse, we can also use the inverse sine and cosine functions in place of the inverse tangent function to find the angle. As with the previous conversion, it is important to clearly identify the opposite leg, the adjacent leg, and the hypotenuse in our diagrams and to think of these when applying the inverse trig functions.

## Converting Between Forms in 3D

In three dimensions, we will have either three components (x, y, and z) for component form or a magnitude and two angles for the direction in magnitude and direction form. To convert between forms we will need to draw in two sets of right triangles. The hypotenuse of the first triangle will be the original vector and one of the legs will be one of the three components. The other leg will then be the hypotenuse of the second triangle. The legs of this second triangle will then be the remaining two components as shown in the diagram below. Use sine and cosine relationships to find the magnitude of each component along the way.

To go from component form back to a magnitude and direction, we will use the 3D form of the Pythagorean theorem (the magnitude will be the square root of the sum of the three components squared) and we can again use the inverse trig functions to find the angles. We simply need to work backwards through the two right triangles.

### Alternative method for finding components of 3D vectors

Sometimes, as with the tension in a cable, the geometry of the cable is given in component form rather than as angles. In cases such as this an alternative method can be used to find the components of the tension in the cable. Rather than using trigonometry, this method instead relies on ratios. The ratios of the components of the cable to the overall length of the cable will be the same as the ratio of the corresponding tension components to the overall magnitude of the tension.

To use this method we will first need to find the overall length of the cable using the Pythagorean Theorem. To find the x component of the tension force, we simply multiply the overall magnitude of the tension force by the x component of the length over the overall length of the cable. We can then repeat with the y and z components.