diff -r 0fad394bc330 -r 31841b366d5e geometry.cpp --- a/geometry.cpp Wed Mar 10 15:36:19 2010 +0000 +++ b/geometry.cpp Mon Mar 15 11:49:42 2010 +0000 @@ -65,10 +65,18 @@ { } +//! Check if length is 0 +bool Vector::isNull() +{ + if (x()==0 && y()==0) + return true; + return false; +} + //! Normalize vector void Vector::normalize () { - if (x()==0 && y()==0) return; + if (isNull() ) return; qreal l=sqrt ( x()*x() + y()*y() ); setX (x()/l); setY (y()/l);