A vector has a size and a direction, written as components such as (2, 3, 4). Adding vectors adds their components. The dot product gives a single number that tells you how much two vectors point the same way. The cross product (3D) gives a new vector perpendicular to both.
- A = (2, 3, 4), B = (5, 6, 7).
- x: 3×7 − 4×6 = -3
- y: 4×5 − 2×7 = 6
- z: 2×6 − 3×5 = -3
- A × B = (-3, 6, -3). It is perpendicular to both A and B. Its size 7.348469 is the area of the parallelogram on A and B.
- Dot product zero means the vectors are perpendicular.
- Cross product zero means the vectors are parallel.
- A × B = −(B × A): swapping the order flips the direction.
Standard component formulas: A·B = ΣAᵢBᵢ, |A| = √ΣAᵢ², cos θ = A·B ÷ (|A||B|), A×B = (AyBz − AzBy, AzBx − AxBz, AxBy − AyBx), projection of A on B = (A·B ÷ |B|²)B. In 2D the cross product is treated as vectors in the z = 0 plane. Results are shown to 7 significant figures.