This is easy if you have basic knowledge of linear algebra.
The vector v (in the sense of linear algebra, not std :: vector;)) is the collection v = (x, y, z).
The norm is the length of the vector | v | = sqrt (xx + yy + z * z)
The inner product of two vectors v1 = (x1, y1, z1) and v2 = (x2, y2, z2) is equal to v1 Β· v2 = x1 * x2 + y1 * y2 + z1 * z2
The angle of the vectors v1 and v2 is a = acos (v1 Β· v2 / (| v1 | * | v2 |))
Tristram grΓ€bener
source share