Calculate distance between two point - Android Map

Android examples for Map:Location Distance

Description

Calculate distance between two point

Demo Code

public class Main {
  public static float distance(float x, float y, float sx, float sy) {
    float dx = x - sx;
    float dy = y - sy;
    return (float) Math.sqrt(dx * dx + dy * dy);
  }/*from w ww.  j  a v  a  2s .  com*/
}

Related Tutorials