Vector calculation – basics
Addition, dot product, cross product, magnitude and angle for 2D and 3D vectors
A vector describes a quantity with magnitude and direction, represented as a tuple of components – e.g. (x, y) in 2D space or (x, y, z) in 3D space. This calculator supports both cases.
For addition and subtraction, the components are calculated individually: a⃗ ± b⃗ = (a₁±b₁, a₂±b₂, a₃±b₃).
The dot product a⃗ · b⃗ = a₁b₁ + a₂b₂ + a₃b₃ yields a number and is used to calculate the angle between two vectors: cos(φ) = (a⃗ · b⃗) / (|a⃗| · |b⃗|). The cross product a⃗ × b⃗, on the other hand, yields a new vector perpendicular to both original vectors – it is defined exclusively in 3D space.
The magnitude (length) of a vector is calculated as the square root of the sum of the squared components: |a⃗| = √(a₁² + a₂² + a₃²) – a direct application of the Pythagorean theorem.