math
Class EuclideanMetric

java.lang.Object
  extended by math.EuclideanMetric
All Implemented Interfaces:
Metric

public class EuclideanMetric
extends java.lang.Object
implements Metric

The Euclidean metric (i.e., the notion of distance that most people are familiar with)

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Constructor Summary
EuclideanMetric()
           
 
Method Summary
 double distance(double[] x, double[] y)
          Calculate the distance between two n-dimensional points (required by Metric) Note: For simplicity, this method does not confirm that the two arrays are the same size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EuclideanMetric

public EuclideanMetric()
Method Detail

distance

public double distance(double[] x,
                       double[] y)
Calculate the distance between two n-dimensional points (required by Metric) Note: For simplicity, this method does not confirm that the two arrays are the same size. It uses the smaller size.

Specified by:
distance in interface Metric
Parameters:
x - One n-dimensional point
y - Another n-dimensional point
Returns:
The distance


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers