Calculate dot product @param vector
double dot(Vec3 vector) { return x * vector.x + y * vector.y + z * vector.z; }