Here you can find the source of distance(final String c1, final String c2, final String c1Prev, final String c2Prev)
public static double distance(final String c1, final String c2, final String c1Prev, final String c2Prev)
//package com.java2s; //License from project: LGPL public class Main { public static double distance(final String c1, final String c2, final String c1Prev, final String c2Prev) { final double d1 = Double.parseDouble(c1) - Double.parseDouble(c1Prev); final double d2 = Double.parseDouble(c2) - Double.parseDouble(c2Prev); return StrictMath.hypot(d1, d2); }//from w w w . jav a 2s . c o m }