Math Calculators
Vector Calculator - Add, Dot Product, Cross Product & More
Perform 2D and 3D vector operations: addition, subtraction, dot product, cross product, magnitude, normalization, and angle between vectors. Step-by-step solutions shown.
Enter components separated by commas or spaces. 2D: "x, y" - 3D: "x, y, z"
Quick examples:
Result
⟨4, 6⟩
Steps
- A + B = ⟨1, 2⟩ + ⟨3, 4⟩
- = ⟨1 + 3, 2 + 4⟩
- = ⟨4, 6⟩
| Element | x / x₁ | y / y₁ | x₂ | y₂ |
|---|---|---|---|---|
| A | 0 | 0 | 1 | 2 |
| B | 0 | 0 | 3 | 4 |
| R | 0 | 0 | 4 | 6 |
What is a vector?
A vector is a mathematical object with both magnitude (length) and direction. In 2D, a vector has two components (x, y); in 3D it has three (x, y, z). Vectors model physical quantities such as displacement, velocity, force, and acceleration.
Vector operations
- Addition / Subtraction: Add or subtract corresponding components: A ± B = ⟨aₓ ± bₓ, aᵧ ± bᵧ⟩.
- Dot product: A · B = aₓbₓ + aᵧbᵧ (+ aᵤbᵤ in 3D). Returns a scalar. Zero means the vectors are perpendicular.
- Cross product (3D only): A × B returns a vector perpendicular to both A and B. Magnitude equals |A||B|sin θ.
- Magnitude: |A| = √(aₓ² + aᵧ² + aᵤ²). The length of the vector.
- Normalize: Â = A / |A|. Returns a unit vector (magnitude = 1) in the same direction.
- Angle between vectors: θ = arccos((A · B) / (|A| |B|)).
Tips for entering vectors
Separate components with commas or spaces: 1, 2 or 1 2 for 2D;
1, 2, 3 or 1 2 3 for 3D. Angle brackets like <1, 2> also work.
Visualizing 2D vectors
A 2D vector ⟨3, 4⟩ can be drawn as an arrow from the origin (0, 0) to the point (3, 4). Its magnitude is √(3² + 4²) = √25 = 5 - the classic 3-4-5 right triangle. This geometric picture connects the algebra to geometry: the vector’s length is the hypotenuse of the right triangle formed by its components, and its direction is the angle the arrow makes with the positive x-axis.
Dot product geometric meaning
The dot product formula A·B = |A||B|cosθ reveals the geometric relationship between two vectors:
- Positive dot product: the vectors point in the same general direction (θ < 90°).
- Zero dot product: the vectors are perpendicular (θ = 90°).
- Negative dot product: the vectors point in opposite general directions (θ > 90°).
This interpretation is more intuitive than the component formula alone and is the basis of lighting calculations in 3D graphics (comparing a surface normal to a light direction).
Real-world applications
- Physics: force, velocity, and acceleration are all vector quantities; vector addition models resultant forces.
- Computer graphics: RGB color values are 3D vectors; lighting shaders compute dot products between surface normals and light direction vectors.
- Navigation: GPS velocity is a vector; adding wind or current vectors gives the true ground track.
- Machine learning: word embeddings and feature vectors use dot products to measure semantic similarity.