Get the dot product between a and b
a
b
static double dotVectors(Vec3 a, Vec3 b ) { return a.x * b.x + a.y * b.y + a.z * b.z; }