Akima spline explained

In applied mathematics, an Akima spline is a type of non-smoothing spline that gives good fits to curves where the second derivative is rapidly varying.[1] The Akima spline was published by Hiroshi Akima in 1970 from Akima's pursuit of a cubic spline curve that would appear more natural and smooth, akin to an intuitively hand-drawn curve. The Akima spline has become the algorithm of choice for several computer graphics applications. Its advantage over the cubic spline curve is its stability with respect to outliers.[2]

Method

Given a set of "knot" points

(xi,yi)i=1...

, where the

xi

are strictly increasing, the Akima spline will go through each of the given points. At those points, its slope,

si

, is a function of the locations of the points

(xi-2,yi-2)

through

(xi+2,yi+2)

. Specifically, if we define

mi

as the slope of the line segment from

(xi,yi)

to

(xi+1,yi+1)

, namely
m
i=yi+1-yi
xi+1-xi

,

then the spline slopes

si

are defined as the followingweighted average of

mi-1

and

mi

,

si=

|mi+1-mi|mi-1+|mi-1-mi-2|mi
|mi+1-mi|+|mi-1-mi-2|

.

If the denominator equals zero, the slope is given as

s
i=mi-1+mi
2

.

The first two and the last two points need a special prescription, for example,

s1=m1,

s
2=m1+m2
2

,sn-1=

mn-2+mn-1
2

,sn=mn-1.

The spline is then defined as the piecewise cubic function whose value between

xi

and

xi+1

is the unique cubic polynomial

Pi(x)

,

Pi(x)=ai+bi(x-xi)+ci(x-x

2+d
i(x-x
3
i)

,

where the coefficients of the polynomial are chosen such that the four conditions of continuity of the spline together with its first derivative are satisfied,

P(xi)=yi,P(xi+1)=yi+1,P'(xi)=si,P'(xi+1)=si+1.

which gives

ai=yi,

bi=si,

c
i=3mi-2si-si+1
xi+1-xi

,

d
i=si+si+1-2mi
(x
2
-x
i)
i+1

.

Due to these conditions the Akima spline is a  C1 differentiable function, that is, the function itself is continuous and the first derivative is also continuous. However, in general, the second derivative is not necessarily continuous.

An advantage of the Akima spline is due to the fact that it uses only values from neighboring knot points in the construction of the coefficients of the interpolation polynomial between any two knot points. This means that there is no large system of equations to solve and the Akima spline avoids unphysical wiggles in regions where the second derivative in the underlying curve is rapidly changing. A possible disadvantage of the Akima spline is that it has a discontinuous second derivative.[3]

External links

Notes and References

  1. Web site: Spline interpolation and fitting – ALGLIB, C++ and C# library. www.alglib.net.
  2. Book: Siddiqi, Al-Lawati, Boulbrachene, Abul Hasan, Mohamed, Messaoud . Modern Engineering Mathematics . CRC . 2017 . 9781498712095.
  3. Web site: The Akima Interpolation.