Dot product
2D: A · B = AxBx + AyBy3D: add AzBz
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.
Directions are measured counterclockwise from the positive x-axis.
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.
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.
Inputs: A = (3, 4), B = (1, 0).
The horizontal part of A is 3 units; the remaining 4 units point perpendicular to B.
Inputs: A = (−3, 4), B = (2, 0).
The negative scalar says A's along-B component points opposite B.
Inputs: A = (2, 1), B = (−1, 2).
A zero dot product verifies that these nonzero vectors are perpendicular.
Inputs: A = (1, 2, 3), B = (4, 5, 6).
The cross-product vector is perpendicular to both inputs; its magnitude is the parallelogram area.
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.
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.
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.
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.
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.
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.
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.
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.
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.