Vector Components Calculator – Resolve a Vector into x and y Components

Use this free Vector Components Calculator to split a vector into its horizontal (x) and vertical (y) parts. Enter the magnitude of the vector and its angle, measured from the positive x-axis, and the calculator resolves it into components.

Almost nothing in physics travels neatly along an axis. A ball is launched at 25° above the horizontal, a rope pulls a sledge at 40°, the wind strikes an aircraft from the side. In every case the honest description of the motion or the force is a single slanted arrow — and slanted arrows are awkward to calculate with, because the x and y directions in a problem must be handled separately. Resolving a vector into components is the standard escape: replace one slanted arrow by two axis-aligned arrows that have exactly the same combined effect. Once that is done, each direction becomes a simple one-dimensional problem.

The components are the vector's projections — its shadows on the two axes. Hold the arrow up and shine a light straight down the y direction: the shadow it casts on the x-axis has length Ax. Shine the light the other way and the shadow on the y-axis is Ay. Because the arrow and its two shadows always form a right-angled triangle with the vector as hypotenuse, the sides are fixed by trigonometry: the side adjacent to the angle θ takes the cosine, the side opposite takes the sine. That is the entire content of Ax = A cos θ and Ay = A sin θ.

Vector Components Calculator — formula and diagram

The split is lossless. The two components between them contain every scrap of information the original vector carried — its size and its direction — which is why you can rebuild the vector from them exactly (magnitude √(Ax² + Ay²), angle from the ratio Ay/Ax). Resolution is step one of nearly every two-dimensional problem in mechanics: projectiles, forces on slopes, collisions, circular motion and relative velocity all begin by taking a vector apart with the two formulas on this page.

A x = A cos θ A y = A sin θ A θ x y

Formula

Ax = A cos θ  and  Ay = A sin θ  •  A is the magnitude, θ the angle from the positive x-axis

The pair of formulas runs both ways. Given the components, the magnitude is recovered by Pythagoras, A = √(Ax² + Ay²), and the angle by θ = tan⁻¹(Ay / Ax) — with the warning that a plain arctangent cannot tell opposite quadrants apart, so the signs of the components must be checked (a two-argument arctangent, atan2, does this automatically). Two ratio forms are worth memorising alongside: cos θ = Ax / A and sin θ = Ay / A, which say that each component is simply the magnitude scaled by the fraction of the vector pointing that way. A component can therefore never exceed the magnitude itself, and the components of a unit vector (A = 1) are exactly cos θ and sin θ.

SymbolMeaningUnits
Amagnitude (length) of the vectorthe vector's own unit (N, m/s, m…)
Axx component — projection onto the x-axissame unit as A; negative if pointing in −x
Ayy component — projection onto the y-axissame unit as A; negative if pointing in −y
θdirection angle, anticlockwise from the +x axisdegrees (this calculator) or radians

Why cosine takes the x and sine takes the y

The assignment is not a convention to memorise but a consequence of the endpoints. Turn the vector until it lies exactly along the x-axis (θ = 0°): the whole vector is now an x component and the y component has vanished, so the x formula must return A and the y formula 0. Cosine does exactly that — cos 0° = 1, sin 0° = 0. Swing the vector up to the y-axis (θ = 90°) and the roles reverse, again matching cos 90° = 0 and sin 90° = 1. Between the endpoints, the unit circle traces out every intermediate split: a vector of length 1 at angle θ ends at the point (cos θ, sin θ) on the unit circle, and a vector of length A is just that picture scaled by A.

There is one systematic exception, and it causes more wrong answers than any other in this topic: angles measured from the y-axis swap the functions. Pendulum problems measure θ from the vertical; navigation bearings are measured clockwise from north. If your angle φ is measured from the y-axis, then Ax = A sin φ and Ay = A cos φ. The physics has not changed — only the labelling of the triangle's sides. Before reaching for cosine, always ask: this angle is measured from which axis? The component next to the measured angle always takes the cosine.

cos θ sin θ θ tip at (cos θ, sin θ) unit circle: a length-1 vector ends at (cos θ, sin θ)

How to use

  1. Enter the magnitude (length) of the vector — a force in newtons, a velocity in m/s, a displacement in metres, whatever your vector measures.
  2. Enter its angle in degrees, measured anticlockwise from the positive x-axis. If your angle is a compass bearing b, convert first: standard angle = 90° − b.
  3. Click "Calculate Components" to get the x and y components. Negative values point in the negative axis direction.
  4. Sanity-check the answer before using it: √(Ax² + Ay²) must give back the magnitude you started with, and neither component may be larger than the magnitude.

Worked examples

Example 1 — the standard split. A vector has magnitude 100 at an angle of 30°. Ax = 100 × cos 30° = 86.6 and Ay = 100 × sin 30° = 50. Most of the vector points along x, because 30° is closer to the x-axis than to the y-axis — the components should always reflect that lean.

Example 2 — the complementary angle. A vector of 50 at 60°: Ax = 50 × cos 60° = 25 and Ay = 50 × sin 60° = 43.3. Compare Example 1: swapping the angle for its complement (90° − θ) swaps the two components, because the triangle is the same shape flipped over.

Example 3 — the equal split. A vector of 200 at 45° points exactly between the axes, so the components are equal: Ax = Ay = 200 × 0.7071 = 141.42. Check: √(141.42² + 141.42²) = √40000 = 200. ✔

Example 4 — quadrant II. A vector of 80 at 120° points up and to the left: Ax = 80 × cos 120° = −40 and Ay = 80 × sin 120° = 69.28. The cosine of an angle past 90° is negative, and that minus sign is not decoration — it is the information that the vector points in the −x direction.

Example 5 — quadrant III. A vector of 25 at 210° points down and to the left, so both components are negative: Ax = 25 × cos 210° = −21.65 and Ay = 25 × sin 210° = −12.5. The magnitudes behave exactly like the 30° case of Example 1 (210° = 180° + 30°); only the signs differ.

Example 6 — a projectile's velocity. A ball is launched at 30 m/s at 25° above the horizontal. Its velocity components are vx = 30 × cos 25° = 27.19 m/s and vy = 30 × sin 25° = 12.68 m/s. This split is the key that unlocks the whole problem: the horizontal component has no acceleration acting on it and stays 27.19 m/s for the whole flight, while gravity works only on the vertical component, slowing it, stopping it at the peak and reversing it on the way down.

Vector components in real life

Projectile motion. As Example 6 shows, splitting the launch velocity turns one curved trajectory into two straight one-dimensional problems — constant horizontal motion plus uniformly accelerated vertical motion — which between them predict range, flight time and maximum height.

Pulling at an angle. Drag a suitcase with its strap at 40° above the horizontal and only the horizontal component of your pull moves the case forward; the vertical component is spent lifting the case slightly, which quietly reduces the normal force and therefore the friction. Engineers resolve strap, tow-rope and cable forces exactly this way before sizing anything.

Aircraft and wind. A plane's velocity through the air and the wind's velocity are both vectors; the crew resolves each into north and east components, adds them component by component, and reads off the true ground track. The same arithmetic, done by the flight computer many times a second, is why your flight follows its planned line despite a crosswind.

River crossings. A boat aiming straight across a river has its velocity split by the current: the component across the river sets the crossing time, the downstream component sets how far the landing point drifts. Ferry captains aim upstream by precisely the angle that cancels the downstream component.

Games and robotics. A joystick pushed diagonally delivers an (x, y) pair; a game character's diagonal speed is normalised using these very components so it does not move faster diagonally than straight. A robot arm's motors are likewise driven in joint components resolved from the desired hand position.

Forces on slopes. On any incline — a wheelchair ramp, a mountain road, a roof — gravity itself must be resolved into a component along the surface and a component into it. That is important enough to deserve its own section below.

weight mg into slope: mg cos θ along slope: mg sin θ θ

Resolving onto tilted axes: the slope trick

Nothing in the formulas says the axes must be horizontal and vertical. On a slope problem the smart move is to rotate the axes so that one lies along the slope and the other perpendicular to it — then the acceleration, the friction and the motion all line up with the new axes, and only gravity needs resolving. A block's weight mg, pointing straight down, makes the same angle θ with the perpendicular-to-slope direction as the slope makes with the horizontal, so the weight splits into mg sin θ along the slope (the part that pulls the block downhill) and mg cos θ into the slope (the part the surface pushes back against, which also sets the friction).

Numbers make it concrete. A 2 kg block on a 30° slope has weight mg = 2 × 9.81 = 19.62 N. Resolved onto slope axes: along the slope, 19.62 × sin 30° = 9.81 N pulling it down the ramp; into the slope, 19.62 × cos 30° = 16.99 N, which is exactly the normal force the surface returns. Notice the cosine now belongs to the "into" component because the angle is being measured against the perpendicular axis — the rule from earlier survives intact: the component next to the measured angle takes the cosine. Choosing axes to fit the problem, rather than forcing the problem to fit horizontal axes, is the single most useful habit this calculator supports.

The payoff arrives when friction enters. Friction's ceiling is set by the into-slope component: with a friction coefficient of μ = 0.3, the most friction can offer is 0.3 × 16.99 = 5.10 N up the slope — less than the 9.81 N pulling the block down it, so the block slides. Its acceleration follows from the components alone: net force along the slope = 9.81 − 5.10 = 4.71 N, and a = 4.71 ÷ 2 = 2.36 m/s². Every quantity in that verdict — the normal force, the friction ceiling, the net pull, the acceleration — came out of resolving one vector, gravity, onto axes the problem chose. That is the slope trick's whole argument.

Quick reference: components of a unit vector

Angle θAx = cos θAy = sin θPoints towards
0°10+x (east)
30°0.8660.5mostly east, some north
45°0.7070.707exactly diagonal
60°0.50.866mostly north, some east
90°01+y (north)
120°−0.50.866north-west
180°−10−x (west)
270°0−1−y (south)

For a vector of any magnitude A, multiply both component columns by A. The table also exposes the pattern of the whole topic: cosine starts at 1 and drains away as the vector rotates towards the y-axis, while sine fills up in exactly the complementary way — the two components trade the vector between them, and their squares always sum to A².

Common mistakes

  • Swapping sine and cosine. The component adjacent to the measured angle takes the cosine. If your angle is measured from the y-axis or from the vertical, the labels swap — check the reference axis before calculating, not after.
  • Leaving the calculator in radian mode. Entering 30 (degrees) into a tool expecting radians resolves the vector at 30 rad — a meaningless direction several full turns away. This page always works in degrees; on a handheld calculator, check the mode indicator.
  • Dropping the sign in quadrants II, III and IV. Cosine is negative from 90° to 270°, sine is negative from 180° to 360°. Reporting 40 instead of −40 in Example 4 points the vector into the wrong half of the plane and ruins every later step.
  • Accepting a component larger than the magnitude. A leg of a right triangle cannot exceed its hypotenuse: |Ax| and |Ay| are each at most A. A bigger "component" always means an error upstream.
  • Using a compass bearing as if it were a standard angle. Bearings run clockwise from north; physics angles run anticlockwise from east. A bearing of 30° is a standard angle of 60° — feed 30° into the calculator unconverted and both components come out wrong.

FAQ

What are vector components?
They are the projections of a vector onto the x and y axes. Together they describe the vector completely: the x component tells how much it acts horizontally, the y component how much it acts vertically.

Why is my component negative?
For angles between 90° and 270° the cosine is negative, so Ax points in the negative x direction. For angles between 180° and 360° the sine is negative, so Ay points in the negative y direction. The signs carry the direction information.

Can I check my answer?
Yes — the components must rebuild the original magnitude: √(Ax² + Ay²) = A. For the example, √(86.6² + 50²) = √(7500 + 2500) = √10000 = 100. ✔

What if my angle is measured from the y-axis?
Swap the functions: Ax = A sin φ and Ay = A cos φ, where φ is the angle from the y-axis. The component next to the measured angle always takes the cosine, whichever axis that is.

Can a component be larger than the vector itself?
No. Each component is one leg of a right triangle whose hypotenuse is the vector, so |Ax| ≤ A and |Ay| ≤ A, with equality only when the vector lies exactly along that axis (θ = 0°, 90°, 180° or 270°).

How do components work in three dimensions?
A third component Az appears, and a second angle is needed to fix the direction (for example, the angle in the x–y plane plus the angle up from that plane). The idea is unchanged — project onto each axis in turn — and the rebuild check becomes √(Ax² + Ay² + Az²) = A.

Why does my handheld calculator give different components?
Almost always the angle mode. If it is set to radians while you type degrees, every sine and cosine is evaluated at the wrong angle. Switch it to DEG mode (this page always uses degrees) and the answers will agree.

What is the unit vector in the direction of A?
It is the vector of length 1 pointing the same way, and its components are simply (cos θ, sin θ) — for the 30° example, (0.866, 0.5). Unit vectors are how directions are stored in physics and graphics software, because multiplying one by any magnitude rebuilds a vector of that size in that direction.

Do the components change if I rotate my axes?
Yes — components are a description of the vector relative to chosen axes, so rotating the axes rewrites both components (the slope section above exploits exactly this). The vector itself — its length and its direction in space — does not change at all.

How do I turn components back into a magnitude and angle?
Use Pythagoras for the size, |A| = √(Ax² + Ay²), and the two-argument arctangent θ = atan2(Ay, Ax) for the direction, so the quadrant comes out right. That reverse journey is exactly what a vector magnitude calculator does.

Sarah Mitchell

Sarah Mitchell

Physics Editor · Motion & Measurement

Sarah Mitchell creates and reviews our kinematics, units and vectors calculators at CalcVIP. Every calculator is checked against hand-worked examples before it is published, so the formula, the diagram and the answer all agree.

View full profile & all calculators by Mitchell →