private void interpolation(){
        // Dimension interpolation arrasys
        this.xInterp = new double[this.nInterpPoints];
        this.yInterp = new double[this.nInterpPoints];

        // Calculate x-axis interpolation points
        double incr = (this.xPositions[this.nData-1] - this.xPositions[0])/(this.nInterpPoints - 1);
        this.xInterp[0] = this.xPositions[0];
        for(int i=1; i<this.nInterpPoints-1; i++){
            this.xInterp[i] = this.xInterp[i-1] + incr;
        }
        this.xInterp[this.nInterpPoints-1] = this.xPositions[this.nData-1];

        CubicSpline cs = new CubicSpline(this.xPositions, this.yPositions);

        // Interpolate y values
        for(int i=0; i<this.nInterpPoints; i++)this.yInterp[i] = cs.interpolate(this.xInterp[i]);

        // Plot interpolated curve
        if(this.plotOpt){
            int nMax = Math.max(this.nInterpPoints, this.nData);
            double[][] plotData = PlotGraph.data(2, nMax);

            plotData[0] = this.xPositions;
            plotData[1] = this.yPositions;
            plotData[2] = this.xInterp;
            plotData[3] = this.yInterp;

            PlotGraph pg = new PlotGraph(plotData);

            pg.setGraphTitle("Cubic Spline Interpolation of Digitised Points");
            pg.setGraphTitle2(this.imagePath);

            pg.setXaxisLegend("x");
            pg.setYaxisLegend("y");

            int[] lineOpt = {0, 3};
            pg.setLine(lineOpt);
            int[] pointOpt = {4, 0};
            pg.setPoint(pointOpt);

            pg.plot();

        }
    }