public boolean contains(double x, double y) {   int crossings = 0; double x1 = getX1(); double y1 = getY1(); double x2 = getX2(); double y2 = getY2();  double dy = y2 - y1; if ((dy > 0.0 && y >= y1 && y <= y2) || (dy < 0.0 && y <= y1 && y >= y2)) { if (x <= x1 + (y - y1) * (x2 - x1) / dy) { crossings++; } }  double ctrlx = getCtrlX(); double ctrly = getCtrlY(); boolean include0 = ((y2 - y1) * (ctrly - y1) >= 0); boolean include1 = ((y1 - y2) * (ctrly - y2) >= 0); double eqn[] = new double[3]; double res[] = new double[3]; fillEqn(eqn, y, y1, ctrly, y2); int roots = solveQuadratic(eqn, res); roots = evalQuadratic(res, roots, include0, include1, eqn, x1, ctrlx, x2); while (--roots >= 0) { if (x < res[roots]) { crossings++; } } return ((crossings & 1) == 1);
public boolean contains(double x, double y) {  throw new Error("not implemented");
	public boolean contains(double x, double y) {		// We count the "Y" crossings to determine if the point is		// inside the curve bounded by its closing line.		int crossings = 0;		double x1 = getX1();		double y1 = getY1();		double x2 = getX2();		double y2 = getY2();		// First check for a crossing of the line connecting the endpoints		double dy = y2 - y1;		if ((dy > 0.0 && y >= y1 && y <= y2) || (dy < 0.0 && y <= y1 && y >= y2)) {			if (x <= x1 + (y - y1) * (x2 - x1) / dy) {				crossings++;			}		}		// Solve the Y parametric equation for intersections with y		double ctrlx = getCtrlX();		double ctrly = getCtrlY();		boolean include0 = ((y2 - y1) * (ctrly - y1) >= 0);		boolean include1 = ((y1 - y2) * (ctrly - y2) >= 0);		double eqn[] = new double[3];		double res[] = new double[3];		fillEqn(eqn, y, y1, ctrly, y2);		int roots = solveQuadratic(eqn, res);		roots = evalQuadratic(res, roots, include0, include1, eqn, x1, ctrlx, x2);		while (--roots >= 0) {			if (x < res[roots]) {				crossings++;			}		}		return ((crossings & 1) == 1);	}