Vector Calculator — Add, Subtract, Dot & Cross Products
Compute vector operations including addition, subtraction, dot product, cross product, magnitudes, and the angle between vectors in 2D or 3D.
See it worked out
Example — v₁x 2, v₁y 3, v₁z 0, v₂x 5:
Sum (v₁ + v₂)
(7, 9, 0)
Difference (v₁ − v₂)
(-3, -3, 0)
|v₁|
3.605551
|v₂|
7.81025
Dot Product (v₁·v₂)
28
Cross Product (v₁ × v₂)
(0, 0, -3)
Angle Between
6.115504°
The formula
a · b = |a||b|cos θ | a × b = (a₂b₃−a₃b₂, a₃b₁−a₁b₃, a₁b₂−a₂b₁)
- v₁ = (x₁, y₁, z₁)
- First Vector
- v₂ = (x₂, y₂, z₂)
- Second Vector
- |v|
- Magnitude (Length)
- a · b
- Dot Product
- a × b
- Cross Product
Worked example — v₁x 2, v₁y 3, v₁z 0, v₂x 5
Sum (v₁ + v₂) = (7, 9, 0)
How Vector Calc Works
a · b = |a||b|cos θ | a × b = (a₂b₃−a₃b₂, a₃b₁−a₁b₃, a₁b₂−a₂b₁)
Vector operations are fundamental in physics, engineering, and computer graphics. The vector sum is computed component-wise, while the dot product yields a scalar representing the projection of one vector onto another. The cross product produces a third vector perpendicular to both inputs. The angle between vectors is derived from the dot product formula: cos θ = (a·b)/(|a||b|).
- v₁ = (x₁, y₁, z₁)
- First Vector — The first input vector defined by its three spatial components.
- v₂ = (x₂, y₂, z₂)
- Second Vector — The second input vector defined by its three spatial components.
- |v|
- Magnitude (Length) — The length of a vector, calculated as √(x² + y² + z²). Always non-negative.
- a · b
- Dot Product — The scalar product: a₁b₁ + a₂b₂ + a₃b₃. Measures alignment between vectors.
- a × b
- Cross Product — The vector product: a 3D vector perpendicular to both a and b. Magnitude equals area of parallelogram.
How to Use
- Enter the x, y, and z components of both vectors. For 2D vectors, leave the z components as 0.
- The calculator computes addition, subtraction, magnitudes, dot product, cross product, and the angle between vectors.
- Review the results: addition and subtraction show component-wise results; the angle shows how aligned the vectors are.
- Vectors with z = 0 are treated as 2D vectors, but cross product results will still be displayed in 3D format.
Quick Reference
| Addition | v₁ + v₂ = (x₁+x₂, y₁+y₂, z₁+z₂) |
| Dot product | a · b = |a||b|cos θ |
| Cross product | |a × b| = |a||b|sin θ |
| Angle | θ = arccos((a·b)/(|a||b|)) |
Common Uses
- •Physics: calculating net force by adding force vectors, computing work as the dot product of force and displacement.
- •Computer graphics: representing positions, directions, velocities, and normals; performing lighting calculations using dot products.
- •Engineering: analyzing structural forces, moments (torque uses cross product), and fluid velocity fields.
- •Machine learning: representing feature vectors and computing similarity using dot products in high-dimensional spaces.
- •Robotics: describing robot arm positions and orientations, computing transformations between coordinate frames.
Understanding the Result
Vectors are mathematical objects with both magnitude and direction, represented as ordered tuples of numbers. In 2D, a vector has two components (x, y); in 3D, three components (x, y, z). Vector addition is performed component-wise and geometrically follows the parallelogram law. The dot product (or scalar product) produces a scalar from two vectors and is zero when the vectors are perpendicular — making it invaluable for testing orthogonality. The cross product exists only in 3D and produces a vector perpendicular to both inputs, with magnitude equal to the area of the parallelogram they span. The right-hand rule determines the direction of the cross product. The angle between vectors is derived from the dot product formula, and the angle is 0° for parallel vectors, 90° for perpendicular vectors, and 180° for anti-parallel vectors. Vector operations are the mathematical foundation for describing physical quantities like force, velocity, acceleration, and electromagnetic fields.
Frequently Asked Questions
- What is the difference between the dot product and the cross product?
- The dot product produces a scalar (a single number) and measures how much two vectors point in the same direction. It is commutative: a·b = b·a. The cross product produces a vector perpendicular to both inputs and measures how much two vectors point in different directions. It is anti-commutative: a × b = −(b × a). The cross product only exists in 3D, while the dot product works in any dimension.
- Can I use this calculator for 2D vectors?
- Yes! Simply leave the z-components as 0 (the default). The calculator will display 2D results for addition and subtraction, though the cross product is inherently a 3D operation. For 2D vectors, the cross product magnitude equals |v₁x·v₂y − v₁y·v₂x|, which represents the signed area of the parallelogram.
- What does a dot product of zero mean?
- A dot product of zero means the vectors are orthogonal (perpendicular) to each other. This is a critically important property in geometry, physics, and linear algebra. For example, in 3D graphics, surface normals are perpendicular to surfaces, so lighting calculations use zero dot products to detect surfaces facing away from the light source.
- How is the angle between vectors calculated?
- The angle is calculated using the dot product formula: cos θ = (a·b)/(|a||b|). Rearranging: θ = arccos((a·b)/(|a||b|)). The result is in the range [0°, 180°], where 0° means the vectors point in exactly the same direction, 90° means they are perpendicular, and 180° means they point in exactly opposite directions.
- What is the geometric meaning of the cross product magnitude?
- The magnitude of the cross product |a × b| equals the area of the parallelogram formed by the two vectors. It is also equal to |a||b|sin θ, where θ is the angle between the vectors. This means the cross product magnitude is maximized when the vectors are perpendicular (sin 90° = 1) and zero when they are parallel (sin 0° = 0).
Cite this calculator
TheCalcUniverse. "Vector Calculator — Add, Subtract, Dot & Cross Products." TheCalcUniverse, 2026, https://thecalcuniverse.com/math/vector-calculator/. Accessed July 24, 2026.
Embed this calculator on your site
You may also like
-
Cross Product
Compute the cross product of two 3D vectors. Shows the resulting vector, magnitude, unit vector, and area of t…
-
Dot Product
Calculate the dot product of two vectors, the angle between them, and determine if they are orthogonal. Suppor…
-
Matrix Calculator
Calculate the determinant and inverse of square matrices from 2×2 to 5×5. Shows step-by-step calculation with …
-
Distance Calculator
Calculate the Euclidean distance between two points in 1D, 2D, or 3D space. Shows the distance formula, step-b…