Understanding Akima
The Akima method has stood the test of time and continues to be one of the most cited curve drawing algorithms. This post is to remind me how it works and to mention a modification, called makima, available in Matlab. Akima's method is one of the family of piecewise cubic interpolants which as we have seen, involve an estimate of the slope at each data point. To explain the method, and to keep things simple, we look at the slope estimate at the third data point (x 3 , y 3 ), which depends on its 4 neighbours, 2 each side. Let m i be the slope of the chord joining (x i , y i ) to (x i+1 , y i+1 ). Then Akima estimates the slope, s 3 as a weighted average of m 2 and m 3 , the two chords meeting at (x 3 , y 3 ). The weights w 1 and w 2 are chosen as follows. Let a 1 = abs(m 4 - m 3 ) and a 2 = abs(m 2 - m 1 ), and let b = a 1 + a 2 . Then we set w 1 = a 1 /b and w 2 = a 2 /b. This gives the weighted average estimate: s 3 = w 1 * m 2...