|
From: Clement L. <the...@gm...> - 2012-10-04 14:37:19
|
Hello, I've written a small patch[a] that adds a harmonic mean function[1] to pm3d corners2color. I've pasted into this private pastebin because the mailing list seems to chomp up my attachment. The correct usages of this harmonic mean is syntactically identical to, say, if you wanted to use geometrical mean (geomean): set pm3d corners2color harmean The reason why I added another 'mean' function is to complete the set. Gnuplot at the moment as two of the three 'pythagorean means'[2]. The harmonic mean is useful as it can offer a truer sense of the average. See this physics example [3]. One question I have is that the harmonic mean is not defined for numbers less than or equal to 0. Should I have harmean4() return 0 in these cases? I hope it's acceptable, I've never written a patch for any open source software before. Clement Law [a] http://rifers.org/paste/harmean/show/1883 [1] http://en.wikipedia.org/wiki/Harmonic_mean [2] http://en.wikipedia.org/wiki/Pythagorean_means [3] http://en.wikipedia.org/wiki/Harmonic_mean#Physics |