How this calculation works
The dot product combines matching components into a scalar. The cross product is a 3D perpendicular vector; two-component inputs use z = 0. Projection resolves A along the direction of B. The angle uses the dot and cross products, and is undefined if either vector is zero. The adjustable camera projects two- or three-component vectors into an SVG view. Camera changes affect only the sketch; all dot products, norms and vector relationships use the entered components.
A · B = Σ AᵢBᵢ; proj_B(A) = [(A · B)/(B · B)] BA worked example
For A = (1,2,3) and B = (4,5,6), A · B = 32 and A × B = (−3,6,−3).
Good to know
Flat Cartesian coordinates with matching units. Each component is between −1,000,000 and 1,000,000; decimal inputs allow up to 6 places and integer fractions have denominators up to 1,000,000. Expressions are not parsed. Exact intermediate fractions have a size limit; reduce unusually complex inputs if that limit is reached. Lengths and angles are decimal approximations.
Reference: OpenStax: vector and plane equations (opens in a new tab) ↗
Different products answer different questions
The dot product produces one number. It measures how strongly two directions align, with both vector lengths included. A positive value indicates an acute angle for nonzero vectors, zero indicates perpendicular directions, and a negative value indicates an obtuse angle.
The cross product produces a perpendicular vector in three dimensions. Reversing the input order reverses its sign. For (1,0,0) crossed with (0,1,0), the result is (0,0,1); reversing the inputs gives (0,0,−1). That order matters in orientation and torque calculations.
Two-component inputs are placed in the xy plane by assigning z = 0. Their 3D cross product therefore points along the z axis. The reported cross product is not an entry-by-entry multiplication.
A plane through three points uses the cross product of two independent displacement vectors as a normal direction; collinear points cannot supply that normal.
Projection separates an along-direction part from a remainder
Projecting A onto B gives the component of A along the line spanned by B. Subtracting that projection from A gives the rejection, which is perpendicular to B. For A = (3,4) and B = (1,0), the projection is (3,0) and the rejection is (0,4).
Scaling B by a nonzero factor changes its length but not the projection onto its line. Swapping A and B does change the question: the vector being resolved and the target direction have exchanged roles.
A zero vector still has valid sums, differences, dot products and cross products. It has no direction, so an angle involving it is undefined. Projection onto a zero B is undefined as well. The tool keeps the defined results visible and identifies those exceptions separately.
Rotate the camera without changing the vector
The camera controls change an oblique view of the entered components. A projected length or angle on screen is not the true three-dimensional length or angle reported by the calculation. Two different vectors can even line up in a particular projection.
The dot product, cross product and projection formulas always use the original real components. A zero direction vector leaves its angle or projection undefined rather than creating a meaningful direction from the view settings. The angle type identifier classifies a supplied planar angle; it does not replace this vector calculation.
A few questions, answered
Are the components exact?
Accepted integers, finite decimals and fractions are processed as exact rational values for algebraic outputs. Lengths and angles use decimal approximations.
Can I mix a 2D and a 3D vector?
Use the same number of components in both fields. Add an explicit zero third component if you want a 2D direction represented in 3D.
What angle is shown?
The smaller unsigned angle between two nonzero vectors, from 0° through 180°. It is not a signed planar heading or bearing.