class AreaOfInterest extends GraphicalContext<BorderPane> {

    static Double[] calculateRectangle(final Point2D[] point2D) {
        double leftPoint = point2D[0].getX();
        double rightPoint = point2D[0].getX();
        double topPoint = point2D[0].getY();
        double bottomPoint = point2D[0].getY();

        for (int i = 1; i < point2D.length; i++) {
            if (point2D[i].getX() < leftPoint) {
                leftPoint = point2D[i].getX();
            }
            if (point2D[i].getX() > rightPoint) {
                rightPoint = point2D[i].getX();
            }
            if (point2D[i].getY() > topPoint) {
                topPoint = point2D[i].getY();
            }
            if (point2D[i].getY() < bottomPoint) {
                bottomPoint = point2D[i].getY();
            }
        }

        final Double[] squarePoints = new Double[8];
        final int bias = 15;

        squarePoints[0] = leftPoint - bias;
        squarePoints[1] = topPoint + bias;
        squarePoints[2] = rightPoint + bias;
        squarePoints[3] = topPoint + bias;
        squarePoints[4] = rightPoint + bias;
        squarePoints[5] = bottomPoint - bias;
        squarePoints[6] = leftPoint - bias;
        squarePoints[7] = bottomPoint - bias;
        return squarePoints;
    }

    public  AreaOfInterest(final GazePlay gazePlay, final Stats stats);

}