Sub topic 1
Vectors and components: the toolkit
This chapter builds the vector tools used in every later chapter on projectile motion. You will learn to split a vector into components, rebuild it from them, and add vectors without drawing triangles each time. Projectile motion is easy once the horizontal and vertical parts are handled separately, and components make that possible.
Prerequisites
This chapter assumes you can already do the following:
- Basic algebra, including rearranging formulas and solving simple quadratic equations.
- Right-triangle trigonometry: sine, cosine, and tangent, and the Pythagorean theorem.
- Position, velocity, and acceleration in one dimension.
- Optional: basic Python, only for the code examples.
If you can compute the opposite side of a right triangle from an angle and the hypotenuse, you are ready.
Scalars and vectors
A scalar is a quantity described by a number and a unit alone. Mass, time, temperature, and speed are scalars.
A vector is a quantity that has a magnitude (a size) and a direction. Displacement, velocity, and acceleration are vectors. "20 m/s" is a speed. "20 m/s at 30 degrees above the horizontal" is a velocity.
The difference matters for projectiles. A ball thrown upward and a ball thrown sideways can have the same speed, yet they follow different paths because their velocity vectors point in different directions.
In this tutorial a vector is written in bold or with an arrow in textbooks. Here we write the magnitude of a vector v as v and its components as vx and vy.
Choosing a coordinate system
To use components you first choose axes. For projectile motion the standard choice is:
- The x axis is horizontal, positive in the direction the projectile travels.
- The y axis is vertical, positive upward.
- The origin is the launch point, unless a problem says otherwise.
With this choice, gravity points in the negative y direction. Its acceleration is ay = -g, where g is about 9.81 m/s². The sign is the part learners most often get wrong, so fix the convention now: up is positive, down is negative, and you keep that convention through the whole problem.
The axes are your choice, and a different choice would still give correct physics. But a choice that puts gravity along one axis makes the other axis free of acceleration. That is the reason for this setup.
Resolving a vector into components
The components of a vector are the two perpendicular vectors that add up to it. Each lies along one axis.
Take a vector of magnitude v that makes an angle θ with the positive x axis, measured counterclockwise. Draw a right triangle with the vector as the hypotenuse, the horizontal side along x, and the vertical side along y. Then:
vx = v cos θvy = v sin θ
The formulas use the angle measured from the x axis. If a problem gives the angle from the vertical, the roles swap: the horizontal component becomes v sin φ and the vertical one becomes v cos φ, where φ is the angle from the vertical. Always check which axis the angle is measured from before you write down a formula.
Worked example
A ball is kicked at 20 m/s at 30 degrees above the horizontal. Find the components.
vx = 20 cos 30° = 20 × 0.866 = 17.3 m/svy = 20 sin 30° = 20 × 0.5 = 10.0 m/s
Check: sqrt(17.3² + 10.0²) = sqrt(299 + 100) = 20.0 m/s. The components rebuild the original magnitude.
Rebuilding a vector from components
Given vx and vy, the magnitude follows from the Pythagorean theorem:
v = sqrt(vx² + vy²)
The direction follows from the tangent:
θ = arctan(vy / vx)
The plain arctangent has a pitfall. It returns angles only between -90 and +90 degrees, so it cannot tell (-3, -4) from (3, 4), because both give the same ratio. The two-argument form atan2(vy, vx) looks at the signs of both components and returns the correct quadrant. Python provides it as math.atan2.
This matters near the end of a trajectory. When a projectile lands, vx is positive and vy is negative, so the velocity points down and forward. A calculator's arctan gives a negative angle there, and you should read it as "below the horizontal".
Signs and quadrants
The sign of each component tells you the direction along that axis.
| Situation | Sign of vx | Sign of vy |
|---|---|---|
| Moving forward and upward | positive | positive |
| Moving forward and downward | positive | negative |
| Moving backward and upward | negative | positive |
| Moving backward and downward | negative | negative |
For an ideal projectile launched forward, vx stays positive and constant. The sign of vy starts positive, passes through zero at the highest point, and becomes negative on the way down. Later chapters rely on this pattern, especially when you decide which root of a quadratic to keep.
Adding vectors by components
Adding vectors graphically means placing them head to tail. Adding by components is easier and more accurate. Add the x components together and the y components together:
Rx = Ax + BxRy = Ay + By
The same rule applies to subtraction, and to multiplying a vector by a scalar: multiply each component by the scalar.
Example: a boat heads across a river at 4 m/s (along +y) while the current pushes it at 3 m/s (along +x).
Rx = 3 + 0 = 3 m/sRy = 0 + 4 = 4 m/s- Magnitude:
sqrt(3² + 4²) = 5 m/s - Direction:
atan2(4, 3) = 53.1°from the current direction
This is the idea behind projectile motion. Each axis can be treated as its own one-dimensional problem, and you combine the results only at the end if you need a magnitude or a direction.
Why components make projectile motion simple
A projectile's acceleration is a vector too, (0, -g). Because it has no horizontal part, the horizontal velocity does not change, and the vertical velocity changes at a constant rate. Splitting the velocity into components turns one two-dimensional problem into two one-dimensional problems you already know how to solve.
The next chapters build on that split. For now, the skill to take away is turning "speed and angle" into (vx, vy) reliably, and back.
A code check
This function converts between the two representations. It is complete and runnable.
import math
def to_components(speed, angle_deg):
"""Return (vx, vy) for a vector at angle_deg above the +x axis."""
theta = math.radians(angle_deg)
return speed * math.cos(theta), speed * math.sin(theta)
def from_components(vx, vy):
"""Return (magnitude, angle in degrees) using atan2 for the right quadrant."""
return math.hypot(vx, vy), math.degrees(math.atan2(vy, vx))
vx, vy = to_components(20.0, 30.0)
print(f"vx = {vx:.2f} m/s, vy = {vy:.2f} m/s")
speed, angle = from_components(vx, vy)
print(f"speed = {speed:.2f} m/s, angle = {angle:.1f} degrees")
# A landing velocity: moving forward and downward.
speed, angle = from_components(17.32, -10.0)
print(f"landing: speed = {speed:.2f} m/s, angle = {angle:.1f} degrees")The last line prints a negative angle, about -30.0 degrees, which means 30 degrees below the horizontal. The function math.radians is needed because Python's trigonometric functions work in radians, not degrees.
Common errors
- Calculator in the wrong mode. If your answers look absurd, check whether the calculator is set to degrees or radians. Python always uses radians.
- Mixing up sine and cosine. The component next to the angle uses cosine. The component opposite the angle uses sine. Sketch the triangle when the angle is measured from the vertical.
- Dropping signs. Entering a magnitude where a signed component belongs gives wrong results, especially for
vyafter the peak and for-g. - Using plain arctan for direction. Use
atan2or reason about the quadrant yourself. - Adding magnitudes instead of components. Two velocities of 3 m/s and 4 m/s add to 5 m/s when perpendicular, not 7 m/s.
Summary
- A vector has a magnitude and a direction. A scalar has only a magnitude.
- For a vector at angle
θfrom the x axis,vx = v cos θandvy = v sin θ. - Rebuild with
v = sqrt(vx² + vy²)andθ = atan2(vy, vx). - Vectors add component by component.
- With up positive, gravity is
-gon the y axis and zero on the x axis.
Exercise
A projectile leaves the ground at 25 m/s at 36.9 degrees above the horizontal (use cos 36.9° = 0.80 and sin 36.9° = 0.60). Find vx and vy. Then, at a later moment, its components are vx = 20 m/s and vy = -15 m/s. Find its speed and the angle of its direction below the horizontal.
Show answer
Launch components: vx = 25 × 0.80 = 20 m/s and vy = 25 × 0.60 = 15 m/s. Later moment: speed = sqrt(20² + 15²) = sqrt(400 + 225) = sqrt(625) = 25 m/s. The angle is atan2(-15, 20) = -36.9°, so the velocity points 36.9° below the horizontal.
Exercise
A wind adds a velocity of (-2, 0) m/s to a drone moving at (6, 8) m/s. What is the drone's resulting velocity vector, its speed, and why can't you get the speed by adding 2 to or subtracting 2 from the original speed of 10 m/s?
Show answer
Add component by component: (6 + (-2), 8 + 0) = (4, 8) m/s. Speed = sqrt(4² + 8²) = sqrt(80) ≈ 8.94 m/s. The wind is not parallel to the original velocity, so the magnitudes do not simply add or subtract. Only components combine linearly.