Example #1
0
        private PointD DeCasteljau(int i, double t)
        {
            PointD P0 = ControlPoints[i];
            PointD P1 = ControlPoints[i + 1];
            PointD P2 = ControlPoints[i + 2];

            //
            P0 = P0.Lerp(P1, t);
            P1 = P1.Lerp(P2, t);
            P2 = P2.Lerp(ControlPoints[i + 3], t);
            //
            P0 = P0.Lerp(P1, t);
            P1 = P1.Lerp(P2, t);
            //
            return(P0.Lerp(P1, t));
        }