public boolean contains(double x, double y) {
		double x0 = getX();
		double y0 = getY();
		double x1 = x0 + dx;
		double y1 = y0 + dy;
		double tSquared = LINE_TOLERANCE * LINE_TOLERANCE;
		if (distanceSquared(x, y, x0, y0) < tSquared) return true;
		if (distanceSquared(x, y, x1, y1) < tSquared) return true;
		if (x < Math.min(x0, x1) - LINE_TOLERANCE) return false;
		if (x > Math.max(x0, x1) + LINE_TOLERANCE) return false;
		if (y < Math.min(y0, y1) - LINE_TOLERANCE) return false;
		if (y > Math.max(y0, y1) + LINE_TOLERANCE) return false;
		if ((float) x0 - (float) x1 == 0 && (float) y0 - (float) y1 == 0) return false;
		double u = ((x - x0) * (x1 - x0) + (y - y0) * (y1 - y0)) / distanceSquared(x0, y0, x1, y1);
		return distanceSquared(x, y, x0 + u * (x1 - x0), y0 + u * (y1 - y0)) < tSquared;
	}