private void addPoint(double t) {
    
        if (Double.isNaN(t))
            return;
        
        if (this.nt >= this.maxnt) {
            /*
             * Create without change.
             */
            double[] dum = new double[2 * this.maxnt];
            
            for(int i=0;i<this.nt;i++)
                dum[i]=this.t[i];
            
            
            this.t = dum;
            this.maxnt *= 2;
        }
        
        if (this.nt == 0 || t >= this.t [this.nt-1]) {   // special case that often occurs in practice
            this.t [this.nt] = t;
            this.nt++;
        } else {
            int left = getLowIndex (t);
            if (left == -1 || this.t [left] != t) {
                for (int i = this.nt-1; i > left; i --) this.t [i + 1] = this.t [i];
                this.nt ++;
                this.t [left+1] = t;
            }
        }
    }