Posts

Showing posts from February, 2025

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...

Post 1980

 The publication of the IMA book in 1980, with my chapter on curve drawing, marked the end of my first foray into this area.  In 1979 I created the curve drawing software for the NAG Graphical Supplement (later the NAG Graphics Library).  This offered a choice of the Osculatory Method (for general datasets) and the Modified Butland Method (for monotonic data).  The software was well used in the 1980s and 1990s. In the early 1980s I was mainly focussed on my work in the Computer Centre at Leicester, my standards work with BCS and my NAG Graphics involvement.  However, in 1985, Rae Earnshaw invited me to a NATO Advanced Study Institute, held at Ilkley, and this was an opportunity to look again at curve drawing algorithms (Brodlie, KW (1985) Methods for Drawing Curves).  Reading this paper again today, I see that I tried to set out properties that one might look for in a curve drawing algorithm - order of method, continuity, global/local, linearity, visual app...

Testing the Methods on Monotonic Data

The papers by Fritsch included two data sets which were used to illustrate the methods and in particular whether they preserved monotonicity (the data sets themselves were monotonic). The first was taken from Akima's 1970 paper, called Akima 3 by Fritsch. x 0.0 2.0 3.0 5.0 6.0 8.0 9.0 11.0 12.0 14.0 15.0 y 10.0 10.0 10.0 10.0 10.0 10.0 10.5 15.0 50.0 60.0 85.0 I ran the five methods I programmed in R on this dataset.  The Osculatory, Ellis/McLain and Akima methods do not preserve monotonicity.  The Butland method and its modification do preserve monotonicity, with hardly any difference in the appearance of the curves produced by the two methods.  Maybe more unevenly spaced data would show some difference? The sec...