Made the method more flexible for other uses.

Vector.dot is not a member of IVector3, manually computing the dot.