diff --git a/Code/Mantid/Framework/Kernel/src/V3D.cpp b/Code/Mantid/Framework/Kernel/src/V3D.cpp index 1710acb8373b9ca56d8cd150ea656fc6cc952b9f..1e6025349131047ff27d5691da3ee6c5ceab6e06 100644 --- a/Code/Mantid/Framework/Kernel/src/V3D.cpp +++ b/Code/Mantid/Framework/Kernel/src/V3D.cpp @@ -482,9 +482,8 @@ V3D::cross_prod(const V3D& v) const double V3D::distance(const V3D& v) const { - V3D dif(*this); - dif-=v; - return dif.norm(); + const double dx(x-v.x), dy(y-v.y), dz(z-v.z); + return sqrt(dx*dx +dy*dy + dz*dz); } /** Calculates the zenith angle (theta) of this vector with respect to another