class LineMath {

	public static boolean isPointOnLineSegment(ILine line, final IVector2 point, final double margin)
	{
		IVector2 lp = leadPointOnLine(line, point);
		double dist = VectorMath.distancePP(point, lp);
		if (dist > margin)
		{
			return false;
		}
		double lineLength = line.directionVector().getLength();
		return VectorMath.distancePP(lp, line.supportVector()) <= (lineLength + margin)
				&& VectorMath.distancePP(lp, line.supportVector().addNew(line.directionVector())) <= (lineLength + margin);
	}

	@SuppressWarnings("unused") private  LineMath();

}