Here you can find the source of distance(double[] a, double[] b)
Parameter | Description |
---|---|
Point | B double[x,y] |
public static double distance(double[] a, double[] b)
//package com.java2s; //License from project: Apache License public class Main { /**/*from ww w . j a v a2 s . c o m*/ * Measure distance between a and b * @param Point A double[x,y] * @param Point B double[x,y] * @return distance between A and B */ public static double distance(double[] a, double[] b) { return Math.sqrt(Math.pow(a[0] - b[0], 2) + Math.pow(a[1] - b[1], 2)); } }