Vector component formulas
Vx = V cos θandVy = V sin θ|V| = √(Vx² + Vy²)andθ = atan2(Vy, Vx)- In 3D,
|V| = √(Vx² + Vy² + Vz²),φ = atan2(Vy,Vx), andθ = atan2(Vz,√(Vx²+Vy²)).
V or |V| is magnitude; Vx, Vy and Vz are Cartesian components; θ is the 2D direction or 3D elevation; and φ is 3D azimuth.
How to find x and y components
Measure the direction counterclockwise from the positive x-axis. Multiply the magnitude by cosine for the horizontal component and by sine for the vertical component. The signs follow the quadrant automatically.
Components from magnitude and direction
Basic 2D example: 10 at 30°
Vx = 10 cos 30° = 8.660 and Vy = 10 sin 30° = 5.000, so V = ⟨8.660, 5.000⟩.
Quadrant example: components −8 and 6
|V| = √((-8)² + 6²) = 10. The quadrant-aware calculation atan2(6,−8) gives 143.130°, correctly placing the vector in quadrant II.
Magnitude and direction from components
Use the Pythagorean formula for magnitude. Use atan2, not plain tan⁻¹(Vy/Vx), because atan2 retains the component signs and therefore identifies the correct quadrant. A zero vector has magnitude zero but no defined direction.
2D versus 3D components
A 2D vector needs x and y. A 3D vector adds z and uses two direction angles: azimuth in the x–y plane and elevation above that plane. From magnitude, azimuth φ and elevation θ: Vx = V cos θ cos φ, Vy = V cos θ sin φ, and Vz = V sin θ.
3D example: ⟨3, 4, 12⟩
|V| = √(3²+4²+12²) = 13, azimuth atan2(4,3) = 53.130°, and elevation atan2(12,5) = 67.380°.
Cartesian components versus projection
| Term | Definition | Formula | Output type |
|---|---|---|---|
| Cartesian component | Amount along a coordinate axis | Vx = V cos θ | Number tied to an axis |
| Scalar component of a along b | Signed length of a along b | compb(a) = (a·b)/|b| | Scalar |
| Vector projection of a onto b | Full vector parallel to b | projb(a) = (a·b/|b|²)b | Vector |
Projection example: a = ⟨6, 8⟩ onto b = ⟨4, 0⟩
a·b = 24, |b|² = 16, and the factor is 24/16 = 1.5. Thus projb(a) = 1.5⟨4,0⟩ = ⟨6,0⟩, scalar projection = 6, and rejection = ⟨0,8⟩.
