Dot product with another vector.
double dot(Vector3D other) => x * other.x + y * other.y + z * other.z;