Java Distance Calculate distanceBetween2Points(float vectorX0, float vectorY0, float vectorXP, float vectorYP)

Here you can find the source of distanceBetween2Points(float vectorX0, float vectorY0, float vectorXP, float vectorYP)

Description

distance Between Points

License

Open Source License

Declaration

public static float distanceBetween2Points(float vectorX0, float vectorY0, float vectorXP, float vectorYP) 

Method Source Code

//package com.java2s;
/**/*from  ww w  . j a va 2 s. c om*/
* @copyright Urucas
* @license   Copyright (C) 2013. All rights reserved
* @version   Release: 1.0.0
* @link       http://urucas.com
* @developers Bruno Alassia, Pamela Prosperi
*/

public class Main {
    public static float distanceBetween2Points(float vectorX0, float vectorY0, float vectorXP, float vectorYP) {
        float x = Math.abs(vectorXP - vectorX0);
        float y = Math.abs(vectorYP - vectorY0);
        return (float) Math.sqrt((x * x) + (y * y));
    }
}

Related

  1. distanceBetween(double x1, double y1, double x2, double y2)
  2. distanceBetween(double x1, double y1, double x2, double y2)
  3. distanceBetween(double xpos1, double ypos1, double xpos2, double ypos2)
  4. distanceBetween2GeoPositionsInMeters(double latA, double lngA, double latB, double lngB)
  5. distanceBetween2Points(float p1[], float p2[])
  6. distanceBetweenPoints(double ax, double ay, double bx, double by)
  7. DistanceBetweenPoints(double x1, double y1, double x2, double y2)
  8. distanceBetweenPoints(float vx, float vy, float wx, float wy)
  9. distanceBetweenPoints(float[] xyz1, float[] xyz2)