|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.aitools.aq.algebra.vector.functions.EuclideanDistance
public final class EuclideanDistance
A Distance
measure for Vector
s.
The Euclidean Distance of two points is defined as the length of
the segment between them. In the vector application, for each vector the
point is taken that would be the position of a point translated from the
origin by the vector.
It is calculated as the square root of the sum of the
squared differences of each coordinate of the vectors.
If one vector is of a lower dimension (range) than the other vector,
the missing dimensions of the vector will be treated as zero.
The Proximity
of two vectors is computed as the negative distance.
The normalized proximity is one minus the distance divided by the highest
double value (Double.MAX_VALUE). And it is 0 if the distance would
be infinite.
Constructor Summary | |
---|---|
EuclideanDistance()
|
Method Summary | |
---|---|
double |
computeDistance(Vector v1,
Vector v2)
Compute a kind of distance between two objects. |
double |
computeNormalizedProximity(Vector v1,
Vector v2)
Compute a kind of proximity between two objects. The value returned by this method has to be between 0 (meaning they are as far away (according to the proximity measure) from each other as possible) and 1 (identical objects according to the proximity measure). |
double |
computeProximity(Vector v1,
Vector v2)
Compute a kind of proximity between two objects. |
double |
computeSquaredDistance(Vector v1,
Vector v2)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EuclideanDistance()
Method Detail |
---|
public double computeSquaredDistance(Vector v1, Vector v2)
v1
- First vector. To be compared to...v2
- ... the second vector
EuclideanDistance
of the two vectorspublic double computeDistance(Vector v1, Vector v2)
Distance
computeDistance
in interface Distance<Vector>
v1
- One object, to be compared to the...v2
- ...second object
public double computeProximity(Vector v1, Vector v2)
Proximity
computeProximity
in interface Proximity<Vector>
v1
- One object, to be compared to the...v2
- ...second object
public double computeNormalizedProximity(Vector v1, Vector v2)
Proximity
computeNormalizedProximity
in interface Proximity<Vector>
v1
- One object, to be compared to the...v2
- ...second object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |