splinebox.spline_curves.HermiteSpline.

arc_length#

HermiteSpline.arc_length(stop=None, start=0)#

Compute the arc length of the spline between the two parameter values specified. If no value for start is give, start from the beginning of the spline. If no value for stop is give, go until the end of the spline. When arrays with multiple values are given for start and/or stop, an array with all of the arc lengths is returned.

Parameters:
stopnp.array / float (optional)

Stop point(s) in parameter space.

startnp.array / float (optional)

Start point(s) in parameter space.

Returns:
arc_lengthfloat or numpy array of floats

The arc length(s) between start and stop.

Examples

>>> M = 5
>>> spline = splinebox.Spline(M=M, basis_function=splinebox.Exponential(M), closed=False)
>>> spline.control_points = np.array([[4.6, 9.1], [8.7, 1.8], [0.3, 1.8], [8.2, 6.5], [5.7, 3.0], [0.3, 4.0], [8.3, 6.6]])

Arc length of the entire spline:

>>> spline.arc_length(M-1)
17.03

Arc length between the thrid and fourth knot:

>>> spline.arc_length(2, 3)
3.08

Arc length steps between knots:

>>> spline.arc_length(np.arange(M - 1), np.arange(1, M))
array([4.982, 5.288, 3.09 , 3.675])