calcRationalCurveDerivatives static method

List<Vector3> calcRationalCurveDerivatives(
  1. List<Vector4> pDers
)

Implementation

static List<Vector3> calcRationalCurveDerivatives(List<Vector4> pDers ) {
  final nd = pDers.length;
  final aDers = [];
  final wders = [];

  for ( int i = 0; i < nd; ++ i ) {
    final point = pDers[ i ];
    aDers[ i ] = Vector3( point.x, point.y, point.z );
    wders[ i ] = point.w;
  }

  final List<Vector3> ck = [];

  for ( int k = 0; k < nd; ++ k ) {
    final Vector3 v = aDers[ k ].clone();
    for ( int i = 1; i <= k; ++ i ) {
      v.sub( ck[ k - i ].clone().scale( calcKoverI( k, i ) * wders[ i ] ) );
    }
    ck[ k ] = v.divideScalar( wders[ 0 ] );
  }

  return ck;
}