Created
July 7, 2014 22:45
-
-
Save whot/c9e66f368a1b895d9c22 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/gnuplot | |
# soften_delta function from libinput/src/filter.c. | |
# | |
# static double | |
# soften_delta(double last_delta, double delta) | |
# { | |
# if (delta < -1.0 || delta > 1.0) { | |
# if (delta > last_delta) | |
# return delta - 0.5; | |
# else if (delta < last_delta) | |
# return delta + 0.5; | |
# } | |
# return delta; | |
# } | |
sd(dx, dx_old) = (abs(dx) < 1.0) ? dx : \ | |
(dx > dx_old) ? dx - 0.5 : \ | |
(dx < dx_old) ? dx + 0.5 : \ | |
dx | |
set xrange [-3:3] | |
set yrange [-3:3] | |
set isosamples 20 | |
splot sd(x, y) with points | |
pause -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment