# Akima spline

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.[2]

## Method

Given a set of "knot" points ${\displaystyle (x_{i},y_{i})}$, where the ${\displaystyle x_{i}}$ are strictly increasing, the Akima spline will go through each of the given points. At those points, its slope, ${\displaystyle s_{i}}$, is a function of the locations of the points ${\displaystyle (x_{i-2},y_{i-2})}$ through ${\displaystyle (x_{i+2},y_{i+2})}$. Specifically, we define ${\displaystyle m_{i}}$ as the slope of the line segment from ${\displaystyle (x_{i},y_{i})}$ to ${\displaystyle (x_{i+1},y_{i+1})}$, namely ${\displaystyle (y_{i+1}-y_{i})/(x_{i+1}-x_{i})}$. Then, ${\displaystyle s_{i}}$ is defined as the following weighted average of ${\displaystyle m_{i-1}}$ and ${\displaystyle m_{i}}$:

${\displaystyle s_{i}={\frac {|m_{i+1}-m_{i}|m_{i-1}+|m_{i-1}-m_{i-2}|m_{i}}{|m_{i+1}-m_{i}|+|m_{i-1}-m_{i-2}|}}}$

The spline is then defined as the piecewise cubic function whose value between ${\displaystyle x_{i}}$ and ${\displaystyle x_{i+1}}$ is the unique cubic polynomial ${\displaystyle P(x)}$ that satisfies the four constraints: ${\displaystyle P(x_{i})=y_{i}}$, ${\displaystyle P(x_{i+1})=y_{i+1}}$, ${\displaystyle P'(x_{i})=s_{i}}$, and ${\displaystyle P'(x_{i+1})=s_{i+1}}$.

The Akima spline is a  C1 differentiable function (that is, has a continuous first derivative) but, in general, will have a discontinuous second derivative at the knot points.[citation needed]

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]

## References

1. ^ "Spline interpolation and fitting – ALGLIB, C++ and C# library". www.alglib.net.
2. ^ Akima, Hiroshi (1970). "A new method of interpolation and smooth curve fitting based on local procedures" (PDF). Journal of the ACM. 17: 589–602. Archived (PDF) from the original on 2020-12-18. Retrieved 2020-12-18.
3. ^