Ad Space — Top Banner

2D Vector Projection Calculator

Project vector A onto vector B in two dimensions.
Find scalar projection, vector projection, perpendicular component, and the angle between the two vectors in degrees.

Vector Projection

The projection of vector A onto vector B answers: how much of A points in the direction of B?

Scalar projection (component of A along B):

comp = (A dot B) / |B|

This is a signed number. Positive means A and B point in roughly the same direction. Negative means they point in roughly opposite directions. The absolute value is the length of the vector projection.

Vector projection:

proj = (A dot B / |B|^2) x B

This is a vector pointing in the direction of B with magnitude equal to the scalar projection. It is the “shadow” of A cast onto the line through B.

Perpendicular component:

A_perp = A - proj

This is the part of A orthogonal to B. Together, the projection and the perpendicular component reconstruct A: proj + A_perp = A.

Angle between vectors:

theta = arccos( (A dot B) / (|A| x |B|) )

Common uses. In physics, projections decompose forces along and perpendicular to a surface — for example, finding the component of gravity along a ramp. In machine learning, dot products and projections appear in neural network activations and PCA. In computer graphics, projections determine how much light falls on a surface.

If the scalar projection is zero, the vectors are orthogonal and their dot product is zero. If it equals |A|, then A lies entirely along B.


Ad Space — Bottom Banner

Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.