Sub topic 1
Vectors and components: the math you need
Prerequisites
This chapter assumes you can do the following:
- Solve two simultaneous linear equations.
- Use sine, cosine, and tangent in a right triangle, and their inverses.
- Describe motion with position, velocity, and acceleration.
- Use SI units: meter (m), kilogram (kg), second (s), and newton (N).
Everything else, including how to handle vectors, is built here. Later chapters use these tools in every problem, so the habits you form now carry through the whole tutorial.
Scalars and vectors
A scalar is a quantity described by a number and a unit alone. Mass (5 kg), time (3 s), and speed (12 m/s) are scalars.
A vector is a quantity that needs a magnitude, a direction, and a unit. Force, velocity, and acceleration are vectors. "10 N" is incomplete as a force. "10 N pointing 30 degrees above the +x axis" is complete.
Notation varies by textbook. This tutorial writes a vector with an arrow in prose, such as F⃗, and writes its magnitude as F. In code and equations we mostly work with components, which are plain signed numbers.
What a component is
A component is the part of a vector that points along one chosen axis. In two dimensions, every vector F⃗ can be replaced by two numbers, Fx and Fy. Together they carry the same information as the magnitude and direction.
The important idea is that components are signed. A positive Fx points along +x. A negative Fx points along −x. The sign is the direction, so you do not need arrows once you have chosen axes.
Resolving a vector into components
Suppose a vector has magnitude F and makes an angle θ measured from the +x axis, counterclockwise. The right triangle formed by the vector and its two components gives:
- F_x = F cos θ
- F_y = F sin θ
These formulas work for any angle from 0° to 360°, and the signs come out right automatically. For θ = 120°, cos θ is negative and sin θ is positive, so the vector points left and up, as it should.
The formulas are tied to the angle's reference. If the angle is measured from the +y axis instead, the roles swap: Fx = F sin φ and Fy = F cos φ. This swap is the most common source of component errors. Before you write a cosine, ask which axis the angle is measured from. The component along that axis gets the cosine. The component perpendicular to it gets the sine.
The following diagram shows the idea as a decision flow.
Recovering magnitude and direction
You often go the other way. Given components, the magnitude follows from the Pythagorean theorem:
F = √(Fx² + Fy²)
The direction comes from the tangent:
θ = arctan(Fy / Fx)
This formula has a trap. A calculator's arctan returns an angle between −90° and +90°, so it cannot tell (3, 4) from (−3, −4). Both give a ratio of 4/3. Use the two-argument function atan2(F_y, F_x), which looks at both signs and returns the correct quadrant.
import math
def resolve(magnitude, angle_deg):
"""Return (Fx, Fy) for a vector at angle_deg from +x, counterclockwise."""
theta = math.radians(angle_deg)
return magnitude * math.cos(theta), magnitude * math.sin(theta)
def magnitude_and_angle(fx, fy):
"""Return (magnitude, angle in degrees from +x, in the range -180 to 180)."""
return math.hypot(fx, fy), math.degrees(math.atan2(fy, fx))
fx, fy = resolve(10.0, 120.0)
print(f"Fx = {fx:.3f} N, Fy = {fy:.3f} N")
mag, ang = magnitude_and_angle(-3.0, -4.0)
print(f"magnitude = {mag:.3f} N, angle = {ang:.1f} degrees")
# Naive arctan gives the wrong quadrant for (-3, -4):
print(f"naive arctan = {math.degrees(math.atan(-4.0 / -3.0)):.1f} degrees")Running it prints Fx = −5.000 N and Fy = 8.660 N for the first vector. The second vector has magnitude 5.000 N at −126.9 degrees, which is in the third quadrant. The naive arctan prints 53.1 degrees, which points the wrong way.
Adding vectors
The sum of vectors is called the resultant. In Newton's second law problems, the resultant of all the forces on an object is the net force.
Adding vectors by drawing arrows tip to tail builds intuition. For calculation, add components separately:
- Rx = Ax + Bx + Cx + …
- Ry = Ay + By + Cy + …
You never add magnitudes of vectors that point in different directions. Two 10 N forces at right angles give a resultant of about 14.1 N, not 20 N. Component addition handles this correctly because the x and y parts are independent.
A worked example
Three forces act on a crate:
- A: 20 N at 0° (along +x)
- B: 15 N at 90° (along +y)
- C: 10 N at 210° (counterclockwise from +x)
Resolve each force and add the components.
| Force | Fx (N) | Fy (N) |
|---|---|---|
| A | 20.000 | 0.000 |
| B | 0.000 | 15.000 |
| C | −8.660 | −5.000 |
| Sum | 11.340 | 10.000 |
For C, cos 210° = −0.866 and sin 210° = −0.5, so both components are negative. The vector points down and left, which matches an angle in the third quadrant.
The magnitude of the resultant is √(11.340² + 10.000²) ≈ 15.12 N. The direction is atan2(10.000, 11.340) ≈ 41.4° above +x. If the crate has mass 3.0 kg, Newton's second law later gives ax = 11.340/3.0 = 3.78 m/s² and ay = 10.000/3.0 = 3.33 m/s². That step belongs to the next chapters. Here the point is the bookkeeping: resolve, tabulate, sum.
Tilted axes
You are free to choose axes. They need only be perpendicular. For a block on a ramp, the most convenient axes run along the slope and perpendicular to it. Then the angle you resolve against is measured from a tilted axis, and the "which axis is this angle measured from?" check matters.
Consider a weight of magnitude W acting straight down on a ramp inclined at angle θ to the horizontal. The angle between the weight and the perpendicular-to-slope axis is also θ. So:
- Component perpendicular to the slope (into the surface): W cos θ
- Component along the slope (down-slope): W sin θ
A quick check: at θ = 0° the ramp is flat, and all of the weight presses into the surface (cos 0° = 1, sin 0° = 0). At θ = 90° the ramp is vertical, and all of the weight is along the slope. The formulas pass both limits. Chapters on axes and inclines develop this fully.
Common errors
- Using the wrong trig function because the angle is measured from the vertical or from a tilted axis.
- Dropping a sign. A force pointing along a negative axis direction must carry a negative component.
- Setting the calculator to the wrong angle mode. If cos 30° does not give 0.866, it is in radians.
- Using arctan on components with mixed signs and reporting the wrong quadrant.
- Adding magnitudes instead of components.
- Rounding components early. Keep extra digits until the final answer.
Quick checks for any resolution
After you resolve a vector, run two checks that take seconds:
- The components should satisfy Fx² + Fy² = F². If not, a trig function is wrong.
- The signs should match a rough sketch of where the vector points.
These checks will be formalized in the chapter on checking your answer, but starting them now prevents errors from compounding in longer problems.
Exercise
A tension of 40 N acts on a sled. The rope makes an angle of 25° above the horizontal, and the sled moves along +x. (a) Find the x and y components of the tension. (b) A second force of 12 N points straight down along −y. Find the resultant of the two forces, as x and y components and as a magnitude.
Show answer
(a) Tx = 40 cos 25° = 36.25 N and Ty = 40 sin 25° = 16.90 N. (b) The second force has components (0, −12). Adding: Rx = 36.25 N and Ry = 16.90 − 12 = 4.90 N. The magnitude is √(36.25² + 4.90²) ≈ 36.58 N, directed atan2(4.90, 36.25) ≈ 7.7° above +x.
Exercise
A force has components Fx = −6.0 N and Fy = 8.0 N. Find its magnitude and its direction measured counterclockwise from +x. Why does arctan(Fy / Fx) alone give the wrong angle here?
Show answer
The magnitude is √(36 + 64) = 10.0 N. The correct direction is atan2(8.0, −6.0) ≈ 126.9° (second quadrant: left and up). Plain arctan(8.0 / −6.0) = arctan(−1.333) ≈ −53.1°, which points right and down. The ratio loses the signs of the individual components, so the calculator cannot tell which quadrant the vector is in. Add 180° to the −53.1° result to get 126.9°, or use atan2.
Exercise
A 50 N weight rests on a ramp inclined at 20° to the horizontal. Using axes along and perpendicular to the slope, find the component of the weight along the slope and the component perpendicular to it. Verify with a limiting-case check.
Show answer
Along the slope: 50 sin 20° = 17.1 N. Perpendicular to the slope: 50 cos 20° = 47.0 N. Check: 17.1² + 47.0² ≈ 2501, and 50² = 2500, so the components reproduce the magnitude. At 0° the formulas give 0 N along the slope and 50 N perpendicular, which is correct for a flat surface.