spline
Creates an empty map with Catmull-Rom spline interpolation.
Uses Catmull-Rom spline interpolation to provide smooth, continuous curves that pass through all control points. This method uses neighboring points to compute smooth tangents, resulting in visually pleasing interpolation.
Suitable for motion profiles, smooth animations, and other applications requiring smooth interpolation across multiple points.
Example:
val map = InterpolatingMap.spline()
map[0.0] = 0.0
map[1.0] = 1.0
map[2.0] = 0.5
val value = map[1.5] // Smooth spline interpolationReturn
an empty InterpolatingMap with Catmull-Rom spline interpolation
Creates a map with Catmull-Rom spline interpolation initialized with given control points.
Uses Catmull-Rom spline interpolation to provide smooth, continuous curves that pass through all control points.
Return
an InterpolatingMap with the given data and Catmull-Rom spline interpolation
Parameters
the x-coordinates of the control points (will be sorted)
the y-coordinates of the control points
Throws
if keys.size != values.size