Orthogonal Projection Calculator

Home›Calculators›Orthogonal Projection Calculator
FREE ONLINE CALCULATOR

Orthogonal Projection Calculator

Find the orthogonal projection of vector a onto vector b — the vector projection, scalar projection, orthogonal component and the angle between them — in 2D or 3D, with the working shown and the answer checked.

✓ 2D and 3D vectors✓ Working shown and checked✓ Free — no sign-up, nothing uploaded
Fixpio VECTOR PROJECTION
a
⊥
projb(a), plus the orthogonal partBoth pieces of a, split along b
2D·3D

Project vector a onto vector b

Type the components — results update as you type. Switch dimension if you are working in 3D.

1 Enter both vectors

Vector a (the vector being projected)

Vector b (the vector you project onto)

Calculated locally in your browser — nothing is uploaded.
Vector projection — projb(a)
—
Scalar projection
—
Orthogonal component — a − projb(a)
—
Dot product a · b
—
Angle between a and b
—
Magnitudes |a| and |b|
—

Working

    Why use this projection calculator?

    Built to give the whole decomposition, not just the headline answer.

    ⊥

    Both projections, plus the rest

    Vector projection, scalar projection, orthogonal component, dot product, magnitudes and angle — one page, one set of inputs, no hopping between separate tools.

    ✓

    Verified, not just calculated

    The page checks its own work: the projection and orthogonal component must add back to a, and the component must be perpendicular to b. If those checks pass, the answer is right.

    ↗

    Made for homework and real work

    Worked steps for students, a live diagram for understanding, and copyable results for everyone else. Nothing is uploaded — the maths runs in your browser.

    About orthogonal projection

    Projecting a vector onto another answers a simple question: how much of vector a points in the direction of vector b? Imagine light shining perpendicular to b and casting a’s shadow onto b’s line — that shadow is the orthogonal projection. What is left over, the part of a that points anywhere except along b, is the orthogonal component. Together they split a into two perpendicular pieces, and that split is one of the most useful moves in linear algebra, physics and data work.

    projb(a) = ( (a · b) / |b|² ) · b · scalar projection = (a · b) / |b| · orthogonal component = a − projb(a)

    The scalar projection is a single signed number: the length of the shadow, positive when a points broadly with b and negative when the angle between them is obtuse (over 90°), because then the shadow falls on the extension of b behind the origin. Multiply that length by b’s unit direction and you get the vector projection. Notice that only b’s direction matters to where the shadow lands — doubling b changes the formula’s numbers but not the resulting projection, which is why b appears squared in the denominator.

    Two situations are worth recognising. If a and b are already perpendicular, the dot product is zero and the projection is the zero vector: a has no component along b at all. And if b itself is the zero vector, projection is undefined — there is no direction to project onto — so this calculator says so plainly instead of returning nonsense. The same formulas work component-wise in 2D, 3D and any higher dimension; this page covers the 2D and 3D cases people meet in coursework and practice.

    In practice, projection is how physics separates a force into the part that does work along a slope and the part that presses into it, how computer graphics work out lighting and shadows on a surface, and how statistics fits a line: a least-squares regression is, geometrically, the projection of the data vector onto the model’s subspace, with the orthogonal component as the residual error. Wherever a quantity needs splitting into “along this direction” and “everything else”, this is the calculation doing it.

    Linear algebra coursework — decompose a vector into parallel and perpendicular components, check homework answers, and prepare for Gram–Schmidt orthogonalisation, which is built from repeated projections. Physics problems — find the component of a force or velocity along a given direction, such as weight acting down a ramp. Graphics and game development — project movement onto a surface direction, reflect vectors, and work with normals. Data and engineering — project measurements onto a reference axis and inspect the orthogonal remainder as the error or deviation.

    Frequently asked questions

    The questions students and practitioners actually ask about projections.

    What is the difference between scalar and vector projection?

    The scalar projection is a single signed number — the length of a’s shadow along b, negative if the angle between them is over 90°. The vector projection is an actual vector: that length applied along b’s direction. They are related by vector projection = scalar projection × (b / |b|). This calculator gives you both.

    How do you calculate the projection of a onto b?

    Use projb(a) = ((a · b) / |b|²) · b. In words: take the dot product of a and b, divide by the squared length of b, and multiply vector b by that number. For a=(3, 4) onto b=(5, 0): the dot product is 15, |b|² is 25, so the projection is (15/25) · (5, 0) = (3, 0). Two checks confirm any answer: the projection and the orthogonal component must add back to the original a, and the orthogonal component dotted with b must be 0, because the two are perpendicular — this page runs both checks on every calculation.

    Can the scalar projection be negative?

    Yes. When the angle between a and b is obtuse (more than 90°), the dot product is negative, so the scalar projection is negative and the vector projection points opposite to b. Example: projecting a=(2, −3, 5) onto b=(3, 6, −4) gives a scalar projection of about −4.0972.

    What is the orthogonal component (rejection) of a vector?

    It is what remains after the projection is removed: a − projb(a). By construction it is perpendicular (orthogonal) to b, which is why the pair is called an orthogonal decomposition. For a=(3, 4) onto b=(5, 0) the orthogonal component is (0, 4) — the part of a that points purely in the y direction.

    What happens if b is the zero vector, or if the vectors are perpendicular?

    If b is the zero vector the projection is undefined, because there is no direction to project onto — this calculator flags it as an error. If a and b are perpendicular, the dot product is 0, the projection is the zero vector and the orthogonal component is a itself.

    Is the projection of a onto b the same as the projection of b onto a?

    No. Projection is not symmetric: it asks how much of the first vector lies along the second, so swapping them asks a different question and generally gives a different answer. For example, (3, 4) onto (5, 0) is (3, 0), while (5, 0) onto (3, 4) is (1.8, 2.4).