Utinzo

Vector Calculator

Add, subtract, and find the magnitude, dot product, and angle between 2D or 3D vectors.

Did this tool work for you?

How to use this calculator

|v| = √(x² + y² + z²); v·w = x₁x₂ + y₁y₂ + z₁z₂; angle = arccos(v·w / |v||w|)

Vector magnitude is the length. Dot product measures projection. The angle formula uses the relationship between dot product and magnitudes.

  1. 1

    Enter x, y, z components for Vector A and Vector B.

  2. 2

    For 2D vectors, leave the z components as 0.

  3. 3

    Results include magnitude, sum, difference, dot product, angle, and cross product.

Frequently asked questions

How do I use it for 2D vectors?

Leave both z fields at 0. Sums, differences, dot product, magnitudes and the angle are then the ordinary 2D values. The cross product will have the form (0, 0, c), where c = AxBy − AyBx is the signed area of the parallelogram the two vectors span. For the defaults (3, 4) and (1, −2) that is (0, 0, −10).

What does the angle row report and in what units?

The angle between the vectors in degrees, from 0° to 180°, computed as arccos(A·B ÷ (|A||B|)). Perpendicular vectors give 90° (dot product 0), vectors pointing the same way give 0° and opposite directions give 180°. The ratio is clamped to the range −1 to 1 so rounding cannot produce an error.

What if one of the vectors is the zero vector?

Its magnitude is 0 and it has no direction, so the angle is not defined. The calculator displays “Undefined (a zero vector has no direction)” instead of a number. The sum, difference, dot product (0) and cross product (0, 0, 0) are still shown.

Why is the cross product (0, 0, 0) for some inputs?

The cross product is the zero vector when the two vectors are parallel or antiparallel, including when one is a multiple of the other. (3, 4, 0) and (6, 8, 0) give (0, 0, 0) with an angle of 0°; (2, 4, 0) and (−1, −2, 0) also give (0, 0, 0), with an angle of 180°.

Is the order of A and B important?

For addition and the dot product, no. For subtraction and the cross product, yes: A − B is the negative of B − A, and A × B = −(B × A). The tool always computes A − B and A × B in that order.

What is the length of the cross product?

It equals |A||B|sin(θ), the area of the parallelogram formed by the two vectors. For (3, 4, 0) and (1, −2, 0) the cross product is (0, 0, −10), so the area is 10. The calculator does not print that length separately; take the magnitude of the printed components yourself.

Does it do unit vectors, projections or scalar multiples?

No. It reports magnitudes, A + B, A − B, A·B, the angle and A × B only. You can get a unit vector by dividing each component by the magnitude, and a projection from A·B ÷ |B|.

How many digits are shown?

Every value is rounded to 4 decimal places, with trailing zeros removed. Entering many-digit components still produces results rounded for display only.

About vector calculator

Vector calculator — sum, dot product, angle and cross product

What it computes

Give two vectors A and B with x, y and z components and the calculator returns seven things: both magnitudes (√(x² + y² + z²)), the sum and difference, the dot product A·B = AxBx + AyBy + AzBz, the angle between them, and the cross product A × B. The dot product is a single number, large and positive when the vectors point the same way, zero when they are perpendicular and negative when they point apart. The cross product is a vector perpendicular to both.

Worked examples

Each result is straight from the tool.

Five vector pairs
ABA · BAngleA × B
(3, 4, 0)(1, −2, 0)−5116.5651°(0, 0, −10)
(1, 2, 3)(4, 5, 6)3212.9332°(−3, 6, −3)
(1, 0, 0)(0, 1, 0)090°(0, 0, 1)
(2, 0, 0)(2, 2, 0)445°(0, 0, 4)
(3, 4, 0)(6, 8, 0)500°(0, 0, 0)

Reading the results in physics terms

If a force A = (3, 4) newtons acts through a displacement B = (1, −2) metres, the work done is the dot product, −5 joules: the force opposes the motion overall. The 116.5651° angle between them confirms the vectors point more than 90° apart. The magnitude of A, which is 5 for (3, 4), is the force’s total size. The cross product of position and force gives a torque vector in the same way, perpendicular to the plane of the two.

Perpendicular and parallel tests

A dot product of zero means two non-zero vectors are perpendicular, as with (1, 0, 0) and (0, 1, 0). A cross product of (0, 0, 0) means they are parallel or antiparallel. Combine the two tests and you can classify any pair without looking at the angle. The (1, 2, 3) and (4, 5, 6) pair is neither: its dot product of 32 and cross product (−3, 6, −3) place it near parallel, 12.9332° apart.

Limits to keep in mind

The tool works with three components; for 2D leave z at 0. The cross product is defined here for 3D vectors, so for 2D data read just the z component. The angle for a zero vector is undefined and flagged as such. Results have no units attached, so keep both vectors in the same unit before adding or subtracting.

Vector Calculator – Utinzo

Learn more from an authoritative source:

Wikipedia
Related tools

Results are estimates for informational purposes only and do not constitute professional financial, medical, legal, or technical advice. Read full disclaimer →