Skip to main content

Vector Projection Calculator

Find the scalar projection and vector projection of one vector onto another, compare A onto B vs B onto A, compute the angle between vectors, check orthogonality, and see a clear 2D projection sketch with step-by-step support.

Background

A projection tells you how much of one vector points in the direction of another. The scalar projection is the signed component length, while the vector projection is the actual vector that lies along the target direction. Students often mix up dot product, scalar projection, and vector projection—this calculator shows all three clearly.

Enter vectors

Tip: Coordinates mode is best for most vector projection homework problems.

Coordinates / components

Magnitude + angle

Angles are measured from the positive x-axis.

Display options

Chips prefill and calculate immediately.

Result

No results yet. Enter vectors and click Calculate.

How to use this calculator

  • Enter vectors using either components or magnitude + angle.
  • Click Calculate to see scalar projection, vector projection, angle, and orthogonality.
  • Compare projBA and projAB to avoid mixing up the direction of projection.
  • Use the sketch to see the projection “shadow” visually.

How this calculator works

  • Dot product: A·B = AxBx + AyBy
  • Scalar projection of A onto B: compB(A) = (A·B)/|B|
  • Vector projection of A onto B: projB(A) = ((A·B)/|B|²)B
  • Angle between vectors: cos(θ) = (A·B)/(|A||B|)

Formula & Equations Used

Magnitude: |A| = √(Ax² + Ay²)

Dot product: A·B = AxBx + AyBy

Scalar projection: compB(A) = (A·B)/|B|

Vector projection: projB(A) = ((A·B)/|B|²)B

Angle: θ = cos-1((A·B)/(|A||B|))

Example Problems & Step-by-Step Solutions

Example 1 — Project A onto B

Let A = (3,4) and B = (5,0). Find the scalar and vector projection of A onto B.

  1. A·B = 3·5 + 4·0 = 15
  2. |B| = √(5² + 0²) = 5
  3. compB(A) = 15/5 = 3
  4. projB(A) = (15/25)B = (3,0)

Example 2 — Orthogonal vectors

Let A = (3,4) and B = (-4,3). Check whether the vectors are orthogonal, and find the projection of A onto B.

  1. A·B = 3(-4) + 4(3) = -12 + 12 = 0
  2. Because the dot product is 0, the vectors are orthogonal.
  3. |B| = √((-4)² + 3²) = √(16 + 9) = 5
  4. compB(A) = (A·B)/|B| = 0/5 = 0
  5. projB(A) = ((A·B)/|B|²)B = 0·B = (0,0)

Example 3 — Negative scalar projection

Let A = (-2,3) and B = (5,0). Find the scalar projection of A onto B and interpret the sign.

  1. A·B = (-2)(5) + 3(0) = -10
  2. |B| = √(5² + 0²) = 5
  3. compB(A) = (A·B)/|B| = -10/5 = -2
  4. The scalar projection is negative, so A points partly in the opposite direction of B.
  5. projB(A) = ((-10)/25)B = (-2,0)

Frequently Asked Questions

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

Scalar projection is a signed number. Vector projection is a full vector pointing along the target direction.

Q: Is projecting A onto B the same as projecting B onto A?

No. The direction and size usually differ because the target vector changes.

Q: When are vectors orthogonal?

Vectors are orthogonal when their dot product is zero.

Q: Why can scalar projection be negative?

A negative scalar projection means the vector points partly opposite the target direction.