Math
Vector Projection Calculator
Enter two vectors and mathcheck computes the projection of a onto b: the vector projection proj_b a, the scalar projection (a · b)/|b|, and the rejection, the part of a perpendicular to b.
It also verifies that projection plus rejection rebuilds a, and shows the angle between the vectors.
Horizontal component of Vector a (the one being projected).
Vertical component of Vector a (the one being projected).
Horizontal component of Vector b (projected onto).
Vertical component of Vector b (projected onto).
Try an example
Result
Vector projection proj_b a
—
- Scalar projection (a · b) / |b|
- —
- Rejection a - proj_b a
- —
- Angle between a and b
- —
- a · b
- —
- Distance from a to the line of b
- —
Student quick launch
Grade planning, algebra checks, and formulas students reach for most.
Study path
Use this calculator with
Follow these when you want the formula behind the answer, a short lesson, or nearby tools in the same topic.
What vector projection means
Projecting a onto b finds the shadow that a casts on the line through b. The A quantity with both a size and a direction, often drawn as an arrow. projection is a vector along b; the scalar projection is its signed length, positive when a leans the same way as b and negative when it leans against b. Subtracting the projection from a leaves the rejection, the piece of a perpendicular to b.
a = ⟨3, 4⟩ onto b = ⟨2, 0⟩
a · b = 6, b · b = 4. proj_b a = (6/4)⟨2, 0⟩ = ⟨3, 0⟩. Scalar projection = 6 / 2 = 3. Rejection = ⟨3, 4⟩ - ⟨3, 0⟩ = ⟨0, 4⟩, which is indeed perpendicular to b.
Where projection shows up
- Physics: the component of a force along a ramp or along the direction of motion (work = force projected onto displacement times distance).
- Geometry: the closest point on a line to a given point is found by projecting onto the line's direction vector.
- Linear algebra: Gram-Schmidt orthogonalization subtracts projections to build perpendicular vectors.
How to use this calculator
- Choose 2D or 3D.
- Enter vector a (the one being projected) and vector b (the direction to project onto).
- Read the vector projection first, then the scalar projection and the rejection.
- Use the rejection magnitude if you need the perpendicular distance from the tip of a to the line through b.
- Open Show the work for the Multiply two vectors piece by piece and add the results to get one number. and the scaling step.
How to read the answer
The vector projection is parallel to b and the rejection is perpendicular to b; added together they give back a exactly, which the calculator checks. A negative scalar projection means the angle between a and b is more than 90°, and a zero projection means the vectors are perpendicular.
Common mistakes and edge cases
- Dividing by |b| instead of |b|^2 in the vector projection formula (|b| is correct only for the scalar projection).
- Projecting b onto a when the problem asks for a onto b; the two results are different vectors.
- Projecting onto the zero vector, which has no direction.
- Forgetting that the projection can point opposite to b when the dot product is negative.
- Mixing up the rejection with the projection; the rejection is the perpendicular part.
Worked examples
Projection onto the x-axis
a = ⟨3, 4⟩ onto b = ⟨2, 0⟩
Vector projection proj_b a
⟨3, 0⟩
Diagonal direction
a = ⟨4, 2⟩ onto b = ⟨1, 1⟩
Vector projection proj_b a
⟨3, 3⟩
Negative projection
a = ⟨-3, 1⟩ onto b = ⟨2, 0⟩
Vector projection proj_b a
⟨-3, 0⟩
Perpendicular vectors
a = ⟨0, 5⟩ onto b = ⟨3, 0⟩
Vector projection proj_b a
⟨0, 0⟩
3D projection
a = ⟨1, 2, 3⟩ onto b = ⟨1, 1, 1⟩
Vector projection proj_b a
⟨2, 2, 2⟩
Decimal components
a = ⟨1.5, 2.5⟩ onto b = ⟨0, 4⟩
Vector projection proj_b a
⟨0, 2.5⟩
Zero direction vector
Vector projection proj_b a
—
Frequently asked questions
What is the formula for projecting a onto b?+
proj_b a = [(a · b) / (b · b)] b. Compute the dot product, divide by the squared length of b, and scale b by that number.
What is the difference between scalar and vector projection?+
The scalar projection (a · b)/|b| is a number: the signed length of the shadow. The vector projection is that shadow as a vector along b.
Can the projection be negative?+
The scalar projection is negative when the angle between a and b exceeds 90°. The vector projection then points in the direction opposite to b.
What is the rejection of a vector?+
The part of a perpendicular to b: a minus its projection onto b. Projection and rejection add back up to a.
Does the length of b matter?+
No. Only the direction of b matters; doubling b leaves the projection unchanged because the b · b in the denominator cancels the extra length.
How is projection related to the distance from a point to a line?+
The rejection's magnitude is the perpendicular distance from the tip of a to the line through the origin in the direction of b.
About this calculator
- Written by
- mathcheck editorial team
- Last reviewed
- September 4, 2026
Method
- Uses the values entered by the user and stable formulas documented on the page.
Related calculators
Dot Product Calculator
Compute the dot product of two 2D or 3D vectors with the angle between them, both magnitudes, the scalar projection, and an orthogonality check, with every multiplication shown.
Unit Vector Calculator
Normalize a 2D or 3D vector to a unit vector with exact rationalized radical components and decimals, plus the magnitude, direction angle, and the opposite unit vector.
Vector Magnitude and Direction Calculator
Find the magnitude (length) and direction angle of a 2D or 3D vector from its components or from two points. Exact radical magnitude, unit vector, direction cosines, and an arrow diagram.
Angle Between Two Vectors Calculator
Find the angle between two 2D or 3D vectors in degrees and radians using the dot product, with the exact cosine, magnitudes, and an acute/obtuse/perpendicular classification.
Distance from Point to Line Calculator
Find the perpendicular distance from a point to a line in 2D (any line form) or from a point to a plane in 3D, with the exact radical form, the foot of the perpendicular, and formula steps.
Cross Product Calculator
Compute the cross product of two 3D vectors with the determinant expansion shown, the magnitude (parallelogram area), the unit normal vector, and a perpendicularity check.
Last updated: September 4, 2026