Vector Projection Calculator - 2D & 3D Vector Projections

Use this vector projection calculator to find both the vector projection and the scalar projection of vector a onto vector b. Enter your components in 2D or 3D for instant, step-by-step coordinates.

Updated: June 19, 2026 • Free Tool

Vector Projection Calculator

Vector A (To Project)

Vector B (Target Vector)

Results

Projection Vector (proj_b a)
(1.6623, 2.0779, 2.4935)
Projection X component (proj_x) 1.6623
Projection Y component (proj_y) 2.0779
Projection Z component (proj_z) 2.4935
Scalar Projection (comp_b a) 3.6467
Dot Product (A . B) 32.0000
Magnitude of Vector B (||b||) 8.7750

What is Vector Projection?

The vector projection calculator is a powerful mathematical tool designed to find both the vector projection and the scalar projection of one vector onto another in 2D or 3D coordinate space.

Geometrically, when we project vector a onto vector b, we are finding how much of vector a points in the direction of vector b. It represents the orthogonal projection of a onto the line spanned by b. Think of it as the directional shadow that vector a casts upon the axis defined by vector b under a perpendicular light source.

This mathematical operation is incredibly useful across several scientific fields. Typical use cases include determining the shadow or component of a vector in a specific direction, decomposing complex force systems in mechanical physics along arbitrary axes or inclined planes, and computing orthogonal projections for coordinate alignment, computer graphics, and machine learning models.

To find the absolute magnitude of any single vector, explore our Vector Magnitude Calculator to calculate 2D and 3D lengths instantly.

Vector Projection Formula

The vector projection of vector a onto vector b is calculated by taking the dot product of a and b, dividing it by the square of the magnitude of b, and then multiplying that scalar result by vector b.

The standard mathematical expression for the vector projection (denoted as projba) is:

proj_b(a) = ((a . b) / ||b||^2) * b

To perform the calculation step-by-step:

  1. Calculate the dot product of the two vectors: a · b = axbx + ayby + azbz.
  2. Find the squared magnitude of target vector b: ||b||2 = bx2 + by2 + bz2.
  3. Divide the dot product by the squared magnitude to get a scalar scaling factor: k = (a · b) / ||b||2.
  4. Multiply the components of vector b by this scaling factor: projb(a) = (k·bx, k·by, k·bz).

According to Paul's Online Notes (Lamar University), vector projection decomposes a vector into perpendicular components, where one component is parallel to the target vector and the other is orthogonal.

To analyze the geometric angle between the two vectors, use our Angle Between Two Vectors Calculator to verify their directional relationship.

Key Concepts Explained

Understanding the difference between the various outputs of vector operations helps clarify how vectors interact. Here are the core concepts involved in projection calculations:

Vector Projection

The actual vector representing the component of vector a in the direction of vector b.

Scalar Projection

The signed length (magnitude) of the vector projection, pointing in the same or opposite direction.

Orthogonal Rejection

The component of the original vector that is perpendicular to the target vector b.

Dot Product

A scalar value measuring the directional alignment and magnitude multiplication of two vectors.

To normalize any vector into a length of one before computing projections, use our Unit Vector tool to obtain direction vectors.

How to Use This Calculator

Computing projections manually is prone to arithmetic slips. Follow these steps to find the projection of a vector using this interface:

1

Select Dimensions

Decide whether you are working in 2D or 3D coordinate space.

2

Enter Vector A

Fill in the coordinates (X, Y, and optional Z) for vector A.

3

Enter Vector B

Enter the components for the target destination vector B.

4

Get Results

Examine the coordinates and magnitudes computed instantly.

To perform simple summation of two or more coordinate sets, explore our Vector Addition page for geometric combination.

Benefits of Using This Calculator

For students, educators, and engineers, this online tool replaces tedious matrix arithmetic with instant validation:

  • Dimensional Versatility: Handles both 2D planar vectors and 3D spatial vectors with a clean interface.
  • Dual Results: Computes the vector projection coordinates and the scalar projection length simultaneously.
  • Self-Learning Value: Displays intermediate components like dot products and magnitudes to assist in homework checking.
  • Zero-vector protection: Automatically detects invalid calculations such as division by zero when projecting onto zero vectors.

To find the directional heading or angle from coordinate baselines, visit our Vector Direction Calculator to inspect angular orientation.

Factors That Affect Your Results

Several properties dictate the final magnitude and direction of the vector projection:

Target Vector Length

The magnitude of the target vector b scales down the projection factor squared.

Angle Between Vectors

Acute angles yield positive scalar projections, obtuse angles yield negative ones, and 90-degree angles result in zero.

Zero Vector Definition

A zero vector cannot be projected onto, as its magnitude is zero, resulting in division by zero.

As published by the textbook publisher OpenStax Calculus, the scalar projection of a vector a onto b is the length of the vector projection, which can be computed as the dot product of a and b divided by the magnitude of b.

For a generalized overview of multidimensional coordinates, read our Vector reference guide.

Vector Projection Calculator - Visualizing orthogonal vector components in 2D and 3D coordinate grids.
Diagram representing the mathematical process of decomposing a vector into parallel and perpendicular elements using vector projection algorithms.

Frequently Asked Questions (FAQ)

Q: What is the definition of a vector projection?

A: A vector projection represents the 'shadow' or perpendicular component of one vector cast onto a target vector. It mathematically isolates the portion of the first vector that points in the exact direction of the second vector.

Q: What is the difference between a scalar projection and a vector projection?

A: A scalar projection is a single number (scalar) representing the signed length of the projection. A vector projection is a complete vector with directional components indicating the projection in coordinate space.

Q: How do you calculate the vector projection?

A: The vector projection is computed by taking the dot product of the two vectors, dividing it by the magnitude squared of the target vector, and multiplying that quotient by the target vector itself.

Q: Why is the dot product used in projections?

A: The dot product measures the alignment of two vectors. It combines their magnitudes and the cosine of the angle between them, which is exactly what is needed to determine the length of the projected shadow.

Q: Does the order matter when projecting one vector onto another?

A: Yes, order matters. Projecting vector a onto b gives a vector pointing in the direction of b. Projecting b onto a gives a vector pointing in the direction of a, which is different in both magnitude and direction.