Works on this device
Vector Calculator
Work with vectors that have 2, 3 or more components. Choose what you want to work out, type the components, and read the answer with its working. Fractions and decimals stay exact, and square roots are shown in exact form and as a decimal.
Enter your values
Check these values
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose Calculate.
Your result
How it was worked out
How to use this calculator
- Choose what you want to work out, for example Cross product (vector product).
- Type each vector as its components with commas or spaces between them:
3, 4, 0or1/2 -3 2.5. You can also type3i - 4j + 2k. - Choose Calculate. The result shows the exact answer, a decimal where it helps, and how it was worked out.
- Choose Download CSV or Copy to keep the result.
The formulas
- Sum and difference: add or subtract matching components. The sum is also called the resultant.
- Number times a vector: multiply every component by the number.
- Dot product: a · b = a₁b₁ + a₂b₂ + a₃b₃ = |a| |b| cos θ. It is a number.
- Cross product: a × b = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁). It is a vector at right angles to both, by the right-hand rule. For two vectors in the plane the page gives the number a₁b₂ − a₂b₁.
- Magnitude: |a| = √(a₁² + a₂² + a₃²). The unit vector is a ÷ |a|.
- Angle: cos θ = (a · b) ÷ (|a| |b|), from 0° to 180°.
- Projection of a onto b: (a · b ÷ b · b) × b. The rejection is a minus the projection.
- Scalar triple product: a · (b × c). Its size is the volume of the box that the three vectors span.
- Components from magnitude and direction: x = r cos θ, y = r sin θ, with θ counter-clockwise from the positive x-axis. For a compass bearing, clockwise from north: x = r sin β, y = r cos β.
- Linear independence: the vectors become the columns of a matrix, which is row-reduced with exact fractions. The number of pivots is the rank.
Worked example
Take a = (3, 4, 0) and b = (1, -2, 2). The sum is (4, 2, 2). The dot product is 3 × 1 + 4 × (-2) + 0 × 2 = -5. The cross product is (4 × 2 − 0 × (-2), 0 × 1 − 3 × 2, 3 × (-2) − 4 × 1) = (8, -6, -10).
The magnitudes are |a| = √25 = 5 and |b| = √9 = 3, so cos θ = -5 ÷ 15 and the angle between the vectors is about 109.471°. The projection of a onto b is (-5 ÷ 9) × b = (-5/9, 10/9, -10/9).
In the plane, a vector with the magnitude 10 at 30° has the components x = 10 cos 30° ≈ 8.66025 and y = 10 sin 30° = 5.
Limits you should know
- A vector can have up to 10 components. The cross product and the triple products need 3 components.
- Results from typed whole numbers, fractions and decimals are exact. Angles, and components worked out from a magnitude and an angle, use ordinary decimal arithmetic and are rounded for display.
- An exact square root is shown when the number under the root is small enough to split into factors; otherwise the root is shown as it is, with its decimal value.
- The page gives numbers and working. It does not draw the vectors, and it does not do vector calculus (vector fields, curl, line integrals) or matrix work (eigenvectors, matrix products).
- Directions in the plane use the positive x-axis as east and the positive y-axis as north.
- This page is a study aid. Check important results with your own working.