Enter two vectors by components, as complete vectors, or by 2D magnitude and direction. Choose which vector to project, then receive the vector and scalar projections, perpendicular rejection, dot product, angle, magnitudes, cross product, areas, and substituted steps.
Enter vectors
Decimals, fractions such as 1/2, and roots such as sqrt(3) are accepted.
Use commas or spaces, with optional < >, ( ), or [ ]. Fractions and sqrt(n) work too.
Use the same complete-vector format as Vector A.
Directions are measured counterclockwise from the positive x-axis.
2D vector diagram
Solid: A
Dashed: B
Solid red: projection
Dotted: perpendicular component
The scale will adjust automatically after calculation.
No vectors are plotted yet. Enter two vectors and calculate.
This 3D view uses the cross-product determinant and numeric vector results instead of flattening 3D coordinates into a misleading 2D plot.
Enter two 3D vectors to see the determinant expansion.
Enter two vectors, choose the projection direction, and select Calculate projection. Your existing results will stay visible if you need to correct an input.
Projection results
Show step-by-step calculations
Vector projection formulas
Let A be the source vector, B the target vector, θ the smaller angle between them, and ‖V‖ the magnitude of vector V. Scalar projection is a signed length; vector projection has both components and direction.
The negative scalar says A's along-B component points opposite B.
3. Orthogonal vectors
Inputs: A = (2, 1), B = (−1, 2).
A · B = (2)(−1) + (1)(2) = 0.
k = 0/5 = 0, so projB(A) = (0, 0).
Rejection = A − 0 = (2, 1).
θ = cos−1(0) = 90°.
A zero dot product verifies that these nonzero vectors are perpendicular.
4. 3D cross product and area
Inputs: A = (1, 2, 3), B = (4, 5, 6).
A × B = ((2)(6) − (3)(5), (3)(4) − (1)(6), (1)(5) − (2)(4)).
A × B = (−3, 6, −3).
‖A × B‖ = √(9 + 36 + 9) = √54 = 3√6 ≈ 7.3485.
Triangle area = ½(3√6) = 3√6/2 ≈ 3.6742.
The cross-product vector is perpendicular to both inputs; its magnitude is the parallelogram area.
Calculation method and accuracy
Author and mathematics review: Starlight Tools Editorial Team. Reviewed: 15 July 2026.
The calculator evaluates permitted numeric input locally, computes dot products and magnitudes directly from components, and derives projection and rejection from the standard formulas above. It uses JavaScript double-precision floating-point arithmetic, so very large values and irrational or fractional input may show tiny rounding differences. A zero target vector is handled as an undefined projection instead of dividing by zero; near-zero comparisons use a scale-aware tolerance.
Quick verification: for A = (3, 4) and B = (1, 0), the answer must be projB(A) = (3, 0), because B is the x-axis direction. The rejection (0, 4) is perpendicular to B since (0, 4) · (1, 0) = 0.
Frequently asked questions
What is the difference between scalar and vector projection?
The scalar projection is the signed length of one vector along the other. The vector projection is that scalar length multiplied by a unit vector in the target direction, so its result is a vector.
Is projecting A onto B the same as projecting B onto A?
No. Projection is not commutative because the target direction and denominator change. Use the direction control to choose exactly which vector is projected onto the other.
Why can a scalar projection be negative?
A negative scalar projection means the source vector points partly opposite the target vector. This occurs when the angle between them is greater than 90 degrees and their dot product is negative.
How do I test whether vectors are orthogonal or parallel?
Nonzero vectors are orthogonal when their dot product is zero. They are parallel when the magnitude of their 3D cross product, or the absolute 2D determinant, is zero, allowing for small floating-point error.
Does the cross product exist in 2D?
A full cross-product vector is defined in 3D. For 2D vectors, this calculator reports the signed determinant a_x b_y − a_y b_x, equivalent to the missing z-component after embedding the vectors in 3D.
What happens with a zero vector?
The dot product and determinant or cross product can still be calculated. An angle needs both vectors to be nonzero, and a projection is undefined when its target vector is zero because its squared magnitude is the denominator.
How does rounding work?
Calculations use JavaScript double-precision floating-point numbers. The precision selector changes displayed decimal places only; it does not reduce the precision used in the calculation.
Can I enter fractions or square roots?
Yes. Component and complete-vector modes accept decimals, fractions such as 1/2, and square roots such as sqrt(3). Results are numerical approximations rather than symbolic exact values.