/// <summary>Evaluates a matrix of basis function values</summary> /// <param name="knots">Knot sequence : n+k values t[0], ... , t[n+k-1]</param> /// <param name="k">Order of the b-spline</param> /// <param name="nodes">Parameter (n) values at which to evaluate, tau[0],...,tau[n-1]</param> /// <returns>Matrix (n x n) of basis function values, B(i,k)(nodes[j])</returns> /// <remarks> /// There are n basis functions, numbered <c>B(0,k), B(1,k), ... , B(n-1,k)</c>. /// <para>The i-th basis function B(i,k) is non-zero only for t[i] < t < t[i+k]</para> /// <para>In the matrix A : <c>A[j][i] = B(i,k)(tau[j])</c> (i = 0,1,...,n-1 ; j = 0,1,...,n-1)</para> /// </remarks> // Token: 0x0600032C RID: 812 RVA: 0x00032398 File Offset: 0x00030598 public static double[,] BasisMatrix(double[] knots, int k, double[] nodes) { int num = knots.Length; int num2 = num - k; double[,] array = new double[num2, num2]; for (int i = 0; i < num2; i++) { for (int j = 0; j < num2; j++) { array[j, i] = SplineMath.EvaluateBasisFunction(knots, i, k, nodes[j]); } } return(array); }
/// <summary>Evaluates value of a b-spline basis function</summary> /// <param name="knots">Knot sequence : n+k values t[0], ... , t[n+k-1]</param> /// <param name="i">Index of basis function (see below)</param> /// <param name="k">Order of the b-spline</param> /// <param name="t">Parameter value at which to evaluate</param> /// <returns>Value of i-th basis function B(i,k)(t)</returns> /// <remarks> /// There are n basis functions, numbered <c>B(0,k), B(1,k), ... , B(n-1,k)</c>. /// <para>The i-th basis function B(i,k) is non-zero only for t[i] < t < t[i+k]</para> /// </remarks> // Token: 0x0600032D RID: 813 RVA: 0x000323E8 File Offset: 0x000305E8 public static double EvaluateBasisFunction(double[] knots, int i, int k, double t) { double[] array = SplineMath.EvaluateBasisFunction(knots, i, k, t, 0); return(array[0]); }