normalize method

V2 normalize()

Implementation

V2 normalize()
{
  double length = this.length;
  if (length > 0) {
    double ilength = 1.0/length;
    return _v2(x*ilength, y*ilength);
  }
  return _v2Zero;
}