Add gnuplot script to explore approximate_distance.

Error is less than 5% for explored range [0,200000].
approx_distance: much more research into dist approximation

approximate_distance.plot now derives the appropriate values to
be used for 8-way fine-tuning of the fast distance approximation
algorithm.  It produces 3 graphs:

  * A unit circle chart showing the locations of the 8
    sample points chosen for the algorithm.

  * A 2D graph of the measured actual error values using the
    derived values and the approximation algorithm with X
    fixed at 10000 and Y along one axis.  Note the scale
    of this graph is in percent.  The y-axis ranges from 0 to
    0.4%.  The maximum error is less than 0.15%.  That is,
    when the actual distance is 100000, the approximated
    value will be between 99850 and 100150.

  * A 3D graph of measured actual error values for all X and Y
    between 0 and 2000.  One of these graphs is zoomed in to show
    the noise of the low level, and another one is zoomed out
    to show just how mirror-smooth it really is.
approx_distance: Improve accuracy of 2d and 3d funcs

Fine-tuning the approx-distance 2d function gives accuracy better
than 99.7% in all cases.  Extending this to the 3d version gives
it also accuracy better than 99% in all cases.  This is an
improvement on the old code which achieved accuracies better
than 95% in most cases.
dda_lookahead.c: move crossing speed calculation into a dedicated function.

This is mostly a preparation for reverse walks through the movement queue,
where crossing speed calculation is done only once, while actually used
speeds can be raised successively with repeated walks.
look-ahead: change crossing speed calculation algorithm.

The new one solely looks at speed differences of individual axes.
This means individual jerks for each axis (good!) and relative
simple maths (also good!).

For details and maths, see comments in the code and
https://github.com/Traumflug/Teacup_Firmware/issues/45 .
look-ahead: move jerk definitions into config.h templates.
dda: reduce code duplication and simplify.

There are three locations in the code that repeat a pattern of
"If z=0 then use 2d-approx(dx,dy), else if x==0 && y==0 then use dz,
else use 3d-approx".

Teach approx_distance_3 to detect these conditions for us and apply
the same logic.  Replace the three call locations with a simple call
to approx_distance_3.

Binary size for the LOOKAHEAD case drops by almost 400 bytes:

  old:  FLASH : 21242 bytes          149%       70%        34%       17%
  new:  FLASH : 20844 bytes          146%       68%        33%       17%

The size for non-LOOKAHEAD drops by 40 bytes:

  old:  FLASH : 16592 bytes          116%       55%        27%       13%
  new:  FLASH : 16552 bytes          116%       54%        27%       13%

We can actually do a little better if we consider the zero-ness of all
three axes, but this does make the code a little bit bigger. Another
change will consider that option. This change simply tries to mimic
the existing functionality.
dda: move dda_find_crossing_speed() to dda.c.

This is a preparation towards going through the existing movement
queue backwards with dda_join_moves() to allow higher feedrates
for lots of short movements.
dda: use the already calculated distance for crossing speed calculation.
dda_lookahead.c: remember movement distance to avoid recalculation.
dda_lookahead.c: clear lookahead variables in case of bailout.

Catched it! :-)

This was causing occasional step losses when a movement with
zero crossF followed a pair with high crossF.