Java Distance Calculate distance(float value1, float value2)

Here you can find the source of distance(float value1, float value2)

Description

Calculates the absolute value of the difference of two values.

License

Open Source License

Parameter

Parameter Description
value1 Source value.
value2 Destination value.

Return

Distance between the two values.

Declaration

public static float distance(float value1, float value2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from  w w  w .  j  a v a2 s .  c o m
     * Calculates the absolute value of the difference of two values.
     * 
     * @param value1
     *        Source value.
     * @param value2
     *        Destination value.
     * @return Distance between the two values.
     */
    public static float distance(float value1, float value2) {
        return Math.abs(value1 - value2);
    }
}

Related

  1. distance(final double[] t1, final double[] t2)
  2. distance(final String c1, final String c2, final String c1Prev, final String c2Prev)
  3. distance(float aX, float aY, float bX, float bY)
  4. distance(float speed, float delta)
  5. distance(float value1, float value2)
  6. distance(float value1, float value2)
  7. distance(float x1, float x2, float y1, float y2)
  8. distance(float x1, float y1, float x2, float y2)
  9. distance(float x1, float y1, float x2, float y2)