/** * Returns a new Point2D in the same direction as this Point2D * with a length of 1. * * @return Point2D */ public final Point2D unit() throws GeometryException { final double len = getLength(); if (len == 0) { throw new GeometryException("can't normalize (0,0)"); } return div(len); }
/** * Returns a new Point2D in the same direction as this Point2D * with a length of 1. * * @return Point2D */ public final Point2D unit() throws GeometryException { final double len = getLength(); if (len == 0) { throw new GeometryException("can't normalize (0,0)"); } return div(len); }
/** * Returns a new Point2D in the same direction as this Point2D * with a length of 1. * * @return Point2D */ public final Point2D unit() throws GeometryException { final double len = getLength(); if (len == 0) { throw new GeometryException("can't normalize (0,0)"); } return div(len); }
/** * Returns a new Point2D in the same direction as this Point2D * with a length of 1. * * @return Point2D */ public final Point2D unit() throws GeometryException { double len = getLength(); if (len == 0) { throw new GeometryException("can't normalize (0,0)"); } return div(len); }