ruzicka function

Ruzicka distance (lowlevel function)