public Point2 SplInterpolate(Spline Spline, float T) { if (Spline.Count == 0) { return(new Point2()); } Spline.Sort(); SplineFunction it = Spline.LastOrDefault(sf => sf.T <= T); return(it.Eval(T)); }
public Point2 CatmullInterpolate(List <Point2> Pts, float T) { if (Pts.Count == 2) { return(Pts[0].Lerp(Pts[1], T)); } Catmull spline = new Catmull(Pts, this); if (spline.Count == 0) { return(new Point2()); } spline.Sort(); SplineFunction it = spline.LastOrDefault(sf => sf.T <= T); return(it.Eval(T)); }