Vector Projection Calculator
Project one 2D or 3D vector onto another and calculate the scalar coefficient.
Calculate a vector projection
Enter Vector A to project it onto the direction defined by Vector B.
About vector projection
Vector projection finds the part of one vector that lies in the direction of another. Imagine shining a light perpendicular to a line: the shadow of Vector A on the line defined by Vector B is its projection onto B. The result is a vector parallel to B, and it captures how much of A acts along that chosen direction.
To calculate the projection of A onto B, first compute the dot product A dot B. Then divide by B dot B, which is the squared magnitude of B. This quotient is a scalar coefficient. Multiplying every component of B by that coefficient gives the projection vector. The calculator displays both the coefficient and the resulting coordinates so you can see the scaling step directly.
The sign of the coefficient conveys direction. A positive value means the projection points in the same direction as B. A negative value means it points opposite B. A coefficient of zero means A and B are perpendicular, so A has no component along B. If A is already parallel to B, the projection reproduces A, even when B has a different length.
Projection is undefined when B is the zero vector because a zero vector provides no direction and makes the formula's denominator zero. This calculator detects that case and asks for a nonzero target vector. For two-dimensional work, enter zero for both z-components. Decimal and negative coordinates are supported, and both vectors should use the same coordinate system.
Vector projections are fundamental in physics and engineering. They resolve forces along ramps, split velocity into horizontal and vertical parts, and calculate work from force and displacement. In geometry, projections find distances and closest points. In computer graphics, they help with lighting, camera transforms, collision response, and coordinate changes. In statistics and machine learning, projection expresses data along selected directions and underlies least-squares methods.
A projection differs from a scalar projection. The scalar projection is the signed length of A along a unit vector in B's direction, while the coefficient shown here is the multiplier applied directly to B. The vector projection itself is unambiguous and remains the same if B is replaced by any nonzero scalar multiple of B. Use the result to decompose A into parallel and perpendicular components by subtracting the projection from A.
Vector projection examples
| Vectors | Projection | Explanation |
|---|---|---|
| A = (3, 4), B = (1, 0) | (3, 0) | Only the horizontal part remains. |
| A = (2, 2), B = (1, 1) | (2, 2) | A is already parallel to B. |
| A = (1, 0), B = (0, 2) | (0, 0) | Perpendicular vectors have a zero projection. |
How to calculate a vector projection
- Enter all components of Vector A, the vector being projected.
- Enter a nonzero Vector B to define the target direction.
- Use zero for both z-components when working in two dimensions.
- Select Calculate projection and read the coefficient and projection vector.
Vector projection FAQ
What does projecting A onto B mean?
It finds the component of A parallel to B. The resulting vector points along or opposite the direction of B.
Why can I not project onto the zero vector?
The zero vector has no defined direction. It also makes the squared-magnitude denominator in the projection formula equal zero.
Can a projection coefficient be negative?
Yes, a negative coefficient means A points partly opposite B. The projection vector then points opposite the entered direction of B.
What happens when vectors are perpendicular?
Their dot product is zero, so the projection is the zero vector. This means A has no component along B.
How do I find the perpendicular component?
Subtract the projection vector from Vector A. The remainder is orthogonal to Vector B and completes the decomposition.