internal static List<ScreenPoint> CreateSpline(IList<ScreenPoint> points, double tension, double tolerance) {
var screenPointList = new List<ScreenPoint>(points?.Count ?? 0);
if (points == null) return screenPointList;
var count = points.Count;
if (count < 2) {
screenPointList.AddRange(points);
return screenPointList;
}
for (var i = 0; i < count - 1; ++i) {
Segment(screenPointList, points[i == 0 ? 0 : i - 1], points[i], points[i + 1], points[i == count - 2 ? i + 1 : i + 2], tension,
tolerance);
}
return screenPointList;
}