Vector Calculator
Perform common operations on 2D and 3D vectors. Calculate the sum, difference, scalar multiples, dot product, cross product, magnitudes, unit vectors, distance, and angle between vectors.
Enter your vectors
Enter two or three components separated by commas or spaces. Both vectors must have the same dimension.
Calculations are performed by PHP when the form is submitted.
Vector results
Unit vectors
Formulas
Addition
Dot product
Magnitude
Angle between vectors
The angle is reported in degrees. It is undefined if either vector is zero.
3D cross product
How to use the vector calculator
- Enter Vector A using two components for 2D or three for 3D.
- Enter Vector B with the same number of components.
- Enter a scalar if you want scalar multiplication results.
- Click Calculate vectors to display all results.
Components can be separated by commas or spaces. Negative and decimal values
are accepted. For example, enter 1, -2, 3.5.
Frequently asked questions
What is a vector?
A vector is a quantity represented by ordered components. A 2D vector has two components, while a 3D vector has three. Vectors are used to represent direction and magnitude in geometry, physics, and linear algebra.
What is the difference between a dot product and a cross product?
The dot product returns a scalar. The 3D cross product returns a vector perpendicular to both input vectors. For two-dimensional vectors, this calculator returns the scalar z-component of their cross product.
Why is the unit vector undefined for a zero vector?
A unit vector is obtained by dividing a vector by its magnitude. The zero vector has magnitude zero, so this division is undefined.
How is the angle between vectors calculated?
The calculator uses the inverse cosine of the dot product divided by the product of the two magnitudes. The answer is shown in degrees.
Related matrix and vector calculators
Remove any link above if its target page does not exist on your website.