private static final Pair<Point[], Point[]> calcCurveControlPoints(final Point[] DATA_POINTS) {
        Point[] firstControlPoints;
        Point[] secondControlPoints;
        int n = DATA_POINTS.length - 1;
        if (n == 1) { // Special case: Bezier curve should be a straight line.
            firstControlPoints     = new Point[1];
            firstControlPoints[0]  = new Point((2 * DATA_POINTS[0].getX() + DATA_POINTS[1].getX()) / 3, (2 * DATA_POINTS[0].getY() + DATA_POINTS[1].getY()) / 3);
            secondControlPoints    = new Point[1];
            secondControlPoints[0] = new Point(2 * firstControlPoints[0].getX() - DATA_POINTS[0].getX(), 2 * firstControlPoints[0].getY() - DATA_POINTS[0].getY());
            return new Pair<>(firstControlPoints, secondControlPoints);
        }

        // Calculate first Bezier control points
        // Right hand side vector
        double[] rhs = new double[n];

        // Set right hand side X values
        for (int i = 1; i < n - 1; ++i) {
            rhs[i] = 4 * DATA_POINTS[i].getX() + 2 * DATA_POINTS[i + 1].getX();
        }
        rhs[0]     = DATA_POINTS[0].getX() + 2 * DATA_POINTS[1].getX();
        rhs[n - 1] = (8 * DATA_POINTS[n - 1].getX() + DATA_POINTS[n].getX()) / 2.0;
        // Get first control points X-values
        double[] x = getFirstControlPoints(rhs);

        // Set right hand side Y values
        for (int i = 1; i < n - 1; ++i) {
            rhs[i] = 4 * DATA_POINTS[i].getY() + 2 * DATA_POINTS[i + 1].getY();
        }
        rhs[0]     = DATA_POINTS[0].getY() + 2 * DATA_POINTS[1].getY();
        rhs[n - 1] = (8 * DATA_POINTS[n - 1].getY() + DATA_POINTS[n].getY()) / 2.0;
        // Get first control points Y-values
        double[] y = getFirstControlPoints(rhs);

        // Fill output arrays.
        firstControlPoints  = new Point[n];
        secondControlPoints = new Point[n];
        for (int i = 0; i < n; ++i) {
            // First control point
            firstControlPoints[i] = new Point(x[i], y[i]);
            // Second control point
            if (i < n - 1) {
                secondControlPoints[i] = new Point(2 * DATA_POINTS[i + 1].getX() - x[i + 1], 2 * DATA_POINTS[i + 1].getY() - y[i + 1]);
            } else {
                secondControlPoints[i] = new Point((DATA_POINTS[n].getX() + x[n - 1]) / 2, (DATA_POINTS[n].getY() + y[n - 1]) / 2);
            }
        }
        return new Pair<>(firstControlPoints, secondControlPoints);
    }
Returns a "niceScaling" number approximately equal to the range.
Rounds the number if ROUND == true.
Takes the ceiling if ROUND = false.

@param RANGE the value range (maxValue - minValue)
@param ROUND whether to round the result or ceil
@return a "niceScaling" number to be used for the value range
src/main/java/eu/hansolo/tilesfx/tools/Helper.java