Projection Calculator: Parallel and Perpendicular Components
Scalar and vector projection of one vector onto another, parallel and perpendicular parts, and the distance and foot of the perpendicular from a point to a line. 2D and 3D.
What is a projection?
The projection of one vector onto another is its shadow along that direction. With light falling at right angles to b, the shadow of a on b is the projection. This splits a into two parts: a parallel part along b and a perpendicular part at right angles to it.
Scalar and vector projection
The scalar projection is a number, the length of the shadow: (a · b) / |b|. The vector projection carries that length along b: ((a · b) / |b|²) × b. The perpendicular part is a minus the projection vector.
Example
For a = (1, 2) and b = (3, 4), the dot product is 1 × 3 + 2 × 4 = 11 and the length of b is 5. The scalar projection is 11 / 5 = 2.2. The projection vector is (11 / 25) × (3, 4) = (1.32, 1.76) and the perpendicular part is (1, 2) − (1.32, 1.76) = (−0.32, 0.24).
Distance from a point to a line and the foot of the perpendicular
The foot of the perpendicular is where the perpendicular dropped from the point meets the line. For a line through A and B, first find t = (AP · AB) / |AB|², then the foot is F = A + t × AB. The distance from the point to the line is the distance from P to F.
Example: the point P(1, 1) is 1 unit from the line through A(4, 0) and B(0, 3), and the foot is (1.6, 1.8).
Where is it used?
The components of a force along and normal to an inclined plane, the offset of a point from a grid line, the closest point of a pipe or beam to another member, and the component of wind along the direction of travel are all found by projection.
Limits
The vector you project onto cannot be zero. The two points defining the line must differ. The foot may fall outside the segment, which the calculator reports separately.
Frequently asked questions
How do you calculate the projection of one vector onto another?
For example a = (3, 4) projected onto b = (4, 3), the scalar projection is 4.8 and the vector projection is (3.84, 2.88). The dot product is scaled using the direction vector length, which must be nonzero, and scalar projection is a signed component rather than an always positive length.
Related calculators
-
Geometry
3D Distance and Vector Calculator
Distance and vector between two points in space, midpoint, vector magnitude, unit vector, direction cosines and the angles with the axes. -
Geometry
Angle from Three Points Calculator
The angle formed at the vertex by three points given as coordinates, in the plane and in space. Also gives the other angles, sides and area of the triangle. -
Geometry
Line Equation Calculator
Equation of a line from two points or from a point and a slope: y = mx + n, general form ax + by + c = 0, slope angle and axis intercepts. -
Physics
Inclined Plane Calculator
Weight components, normal force, friction and acceleration on an inclined plane. Will it slide, the angle of repose, the force to pull it up and the speed at the bottom. -
Geometry
Distance Between Two Points Calculator
Distance between two points from their coordinates, in the plane and in space. Midpoint, coordinate differences, slope and direction angle, with working. -
Geometry
2D Transformation Matrix: Rotate and Translate Coordinates
Translate, rotate, scale and reflect a list of points. Chains the steps in order and gives the 3×3 transformation matrix, the new coordinates and a before and after sketch.
Found a mistake or something missing?
If a value looks wrong, a size is missing or you need a feature, write to us and we will fix it.