Exemple #1
0
        /// <summary>Samples a bernstein polynomial bézier basis function</summary>
        /// <param name="degree">The degree of the bézier curve</param>
        /// <param name="i">The basis function index</param>
        /// <param name="t">The value to sample at</param>
        public static float SampleBasisFunction(int degree, int i, float t)
        {
            ulong  bc    = Mathfs.BinomialCoef((uint)degree, (uint)i);
            double scale = Math.Pow(1f - t, degree - i) * Math.Pow(t, i);

            return((float)(bc * scale));
        }