The scalar product in coordinates, the angle between two vectors and the test for perpendicular vectors
Write A = Aₓi + Aᵧj + Azk and B = Bₓi + Bᵧj + Bzk and multiply out with the distributive law. Because i · i = j · j = k · k = 1 and all mixed products are 0, only three terms survive: A · B = AₓBₓ + AᵧBᵧ + AzB_z. For vectors of the plane there are just two terms. Comparing this with the definition gives the angle: cos θ = (A · B)/(‖A‖‖B‖). Then θ = cos⁻¹(…), the angle whose cosine is this number. Three cases are worth remembering: cos θ = 1 means parallel and in the same direction, −1 means parallel and opposite, and 0 means perpendicular. So the quick test for a right angle is A · B = 0. The table shows what the sign of A · B tells you. Parallel vectors are tested differently: one is a multiple of the other.
| A · B | angle θ between the vectors |
|---|---|
| positive | acute: 0° ≤ θ < 90° |
| zero | right angle: θ = 90° (both vectors non-zero) |
| negative | obtuse: 90° < θ ≤ 180° |
Perpendicular or not? Pick three small numbers a, b, c and write the vector (a, b, c). Try to find another vector, with the dot product 0, by choosing two of its numbers freely and solving for the third. Check with the dot product.