ph-math/src/main/java/com/helger/numbercruncher/mathutils/InterpolationPolynomial.java
public void addDataPoint (final DataPoint dataPoint)
  {
    if (m_nDataPoints >= m_aData.length)
      return;

    m_aData[m_nDataPoints] = dataPoint;
    m_aDivDiff[m_nDataPoints][0] = dataPoint.getY ();

    ++m_nDataPoints;

    for (int order = 1; order < m_nDataPoints; ++order)
    {
      final int bottom = m_nDataPoints - order - 1;
      final float numerator = m_aDivDiff[bottom + 1][order - 1] - m_aDivDiff[bottom][order - 1];
      final float denominator = m_aData[bottom + order].getX () - m_aData[bottom].getX ();

      m_aDivDiff[bottom][order] = numerator / denominator;
    }
  }
public void addDataPoint (final DataPoint dataPoint)
  {
    if (m_nDataPoints >= m_aData.length)
      return;

    m_aData[m_nDataPoints] = dataPoint;
    m_aDivDiff[m_nDataPoints][0] = dataPoint.getY ();

    ++m_nDataPoints;

    for (int order = 1; order < m_nDataPoints; ++order)
    {
      final int bottom = m_nDataPoints - order - 1;
      final float numerator = m_aDivDiff[bottom + 1][order - 1] - m_aDivDiff[bottom][order - 1];
      final float denominator = m_aData[bottom + order].getX () - m_aData[bottom].getX ();

      m_aDivDiff[bottom][order] = numerator / denominator;
    }
  }
public void addDataPoint ( final DataPoint dataPoint ) { if ( m_nDataPoints >= m_aData . length ) return ; m_aData [ m_nDataPoints ] = dataPoint ; m_aDivDiff [ m_nDataPoints ] [ 0 ] = dataPoint . getY ( ) ; ++ m_nDataPoints ; for ( int order = 1 ; order < m_nDataPoints ; ++ order ) { final int bottom = m_nDataPoints - order - 1 ; final float numerator = m_aDivDiff [ bottom + 1 ] [ order - 1 ] - m_aDivDiff [ bottom ] [ order - 1 ] ; final float denominator = m_aData [ bottom + order ] . getX ( ) - m_aData [ bottom ] . getX ( ) ; m_aDivDiff [ bottom ] [ order ] = numerator / denominator ; } }
Add new data point: Augment the divided difference table by appending a new
entry at the bottom of each column.

@param dataPoint
the new data point
Add new data point : Augment the divided difference table by appending a new entry at the bottom of each column .