private void pushToHull(Point[] inPoints, Point[] outPoints) {
        int p1;
        int p2;

        for (p1 = 1; p1 < inPoints.length; p1++)
            if (!outPoints[0].equals(outPoints[p1]))
                break;
        if (p1 == inPoints.length)
            return;

        for (p2 = p1 + 1; p2 < inPoints.length; p2++)
            if (Point.counterClockWise(outPoints[0], outPoints[p1], outPoints[p2]) != 0)
                break;
        convexHull.push(outPoints[p2 - 1]);

        for (int i = p2; i < inPoints.length; i++) {
            Point stackTop = convexHull.pop();
            while (Point.counterClockWise(convexHull.peek(), stackTop, outPoints[i]) <= 0) {
                stackTop = convexHull.pop();
            }
            convexHull.push(stackTop);
            convexHull.push(outPoints[i]);
        }
    }