Projection is a shadow
projb(a) is literally the shadow of a on b—it keeps b’s direction and scales by alignment. The leftover rejection is the sideways “miss.”
2D: a = |a|⟨cos θ, sin θ⟩. 3D: azimuth φ is angle in the x–y plane from +x; elevation θ is angle above the x–y plane.
Projection: proj_b(a) = (a·b / |b|²) b. Rejection (perpendicular to b): rej_b(a) = a − proj_b(a).
Angle between vectors: ∠(a,b) = arccos((a·b)/(|a||b|)).
In 3D mode, results are shown numerically; the preview is disabled. In 2D, the canvas shows a, its x/y components, and projb(a) if b is provided.
Resolving a vector means expressing it in simpler, more useful parts. In a standard Cartesian basis,
a 2D vector is a = ⟨aₓ, aᵧ⟩ and a 3D vector is a = ⟨aₓ, aᵧ, a_z⟩.
The magnitude is |a| = √(aₓ² + aᵧ²) in 2D and |a| = √(aₓ² + aᵧ² + a_z²) in 3D.
The unit vector is â = a / |a| when |a| ≠ 0.
Many problems ask for components relative to another direction, not just the x/y/z axes. If you
supply a reference vector b, you can split a into a part parallel to b
and a part perpendicular to b:
proj_b(a) = (a·b / |b|²) b and rej_b(a) = a − proj_b(a).
This decomposition is fundamental in physics (forces along a ramp), computer graphics (lighting and normals),
and engineering (signal components along a basis).
When you don’t have components but instead know the magnitude and direction, this tool converts angles
to components for you. In 2D, if the direction is an angle θ measured counter-clockwise from
the positive x-axis, then a = |a|⟨cos θ, sin θ⟩. In 3D, we use azimuth φ in the x–y
plane (from +x toward +y) and elevation θ above the x–y plane:
a = |a|⟨cos θ cos φ, cos θ sin φ, sin θ⟩.
The angle between two non-zero vectors follows from the dot product:
a·b = |a||b| cos α, so α = arccos((a·b)/(|a||b|)). If either vector is zero, the
direction is undefined; the calculator warns you when this occurs. All computations run locally in your
browser to keep your data private, and the Share/LaTeX buttons make it easy to reuse results in reports or notes.
projb(a) is literally the shadow of a on b—it keeps b’s direction and scales by alignment. The leftover rejection is the sideways “miss.”
Normalize any vector and you keep only its heading; multiply that unit vector by any magnitude and you instantly “dial in” a new speed.
Rotate your axes by θ and the same vector gets new numbers—components are basis-dependent. Robots and drones constantly swap bases as they turn.
A positive dot means the angle is under 90°, negative means over 90°, and zero nails a perfect right angle—fast alignment check without measuring θ directly.
The length of rejb(a) is the shortest distance from the tip of a to the infinite line in the direction of b. Engineers use this to find “off-axis” error.