Vector Calculator
Dot product, cross product, angle
About This Calculator
A vector is a quantity with both magnitude and direction, represented as an ordered tuple of numbers (components). Vectors describe positions, velocities, forces, and fields in physics and engineering. Key operations include the dot product (scalar result), cross product (vector result), and finding angles between vectors.
Formula
Dot product: A·B = Σ(aᵢ × bᵢ) = |A||B|cos(θ)
Cross product (3D): A×B = (a₂b₃−a₃b₂, a₃b₁−a₁b₃, a₁b₂−a₂b₁)
Magnitude: |A| = √(a₁²+a₂²+a₃²)
Angle between: θ = arccos(A·B / (|A||B|))
Example Calculation
Find dot product and angle for A=(1,2,3) and B=(4,−1,2).
- A·B = 1×4 + 2×(−1) + 3×2 = 4 − 2 + 6 = 8
- |A| = √(1+4+9) = √14 ≈ 3.742; |B| = √(16+1+4) = √21 ≈ 4.583
- cos(θ) = 8 / (3.742 × 4.583) = 8/17.15 ≈ 0.4665
- θ = arccos(0.4665) ≈ 62.2°
A·B = 8; angle ≈ 62.2°
Dot Product Interpretation
| Dot Product | Angle | Vectors are |
|---|---|---|
| A·B > 0 | θ < 90° | Pointing generally the same direction |
| A·B = 0 | θ = 90° | Perpendicular (orthogonal) |
| A·B < 0 | θ > 90° | Pointing generally opposite directions |
| A·B = |A||B| | θ = 0° | Parallel, same direction |
| A·B = −|A||B| | θ = 180° | Parallel, opposite direction |
Frequently Asked Questions
What is the difference between a scalar and a vector?
A scalar has only magnitude (e.g. temperature, speed, mass). A vector has both magnitude and direction (e.g. velocity, force, displacement). Adding two scalars gives a scalar; adding two vectors requires component-wise addition.
When is the cross product used?
The cross product A×B gives a vector perpendicular to both A and B, useful for computing torque, surface normals in 3D graphics, and determining rotation axes. Its magnitude equals the area of the parallelogram formed by A and B.
What does it mean for vectors to be orthogonal?
Two vectors are orthogonal (perpendicular) if their dot product is zero. This is a fundamental concept in linear algebra, signal processing (orthogonal signals don't interfere), and statistics (uncorrelated variables).
What is a unit vector?
A unit vector has magnitude 1 and indicates direction only. Divide any vector by its magnitude to get a unit vector: û = A/|A|. The standard unit vectors are i=(1,0,0), j=(0,1,0), k=(0,0,1).