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.
Vectors show both size and direction, which makes them essential for everything from physics homework to robotics and game development. This calculator helps you break a vector into clear, usable parts: its components, magnitude, unit vector, and (when you add a reference vector) its projection and rejection. If you are working in 2D or 3D coordinates, the tool gives an instant, readable breakdown so you can focus on understanding the geometry rather than doing repetitive calculations by hand.
In Cartesian coordinates, a 2D vector is written as a = ⟨aₓ, aᵧ⟩ and a 3D vector as
a = ⟨aₓ, aᵧ, a_z⟩. The magnitude (or length) tells you how long the vector is:
|a| = √(aₓ² + aᵧ²) in 2D and |a| = √(aₓ² + aᵧ² + a_z²) in 3D. The unit vector
â = a / |a| keeps the direction while normalizing the length to 1, which is useful in navigation,
physics, and computer graphics.
Often you need a vector’s component along another direction. If you provide a reference vector
b, the calculator splits a into a parallel part and a perpendicular part:
proj_b(a) = (a·b / |b|²) b and rej_b(a) = a − proj_b(a). This is the same idea
used to resolve forces on a ramp, align a velocity with a heading, or separate a signal into a preferred
basis.
You can enter vectors either by components or by magnitude and angles. In 2D, an angle θ from
the positive x-axis gives a = |a|⟨cos θ, sin θ⟩. In 3D, the calculator uses azimuth φ
in the x–y plane and elevation θ above it:
a = |a|⟨cos θ cos φ, cos θ sin φ, sin θ⟩.
a by components or by magnitude and angles.b to compute projection and rejection.Real-world examples include decomposing wind velocity into headwind and crosswind, resolving forces in statics problems, computing a robot’s motion along a desired path, or measuring how closely two directions align using the angle from the dot product. All calculations run locally in your browser for speed and privacy, and the output is formatted for quick copying into homework, documentation, or design 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.