Orbital library

orbital.math Interface Metric

`public interface Metric`

This interface imposes a metric on the objects supported by it. A metric is a measure for distances.

 d:A×A→R is a metric (or distance function) on A if ∀x,y,z,w∈A (def) d(x,y)=0 ⇔ x=y "(positive?) definite" (s) d(x,y) = d(y,x) "symmetric" (Δ) d(x,y) ≤ d(x,z) + d(z,y) "triangular inequality" ⇒ (even for half-metrics, i.e. without definite) (□) |d(x,y) - d(z,w)| ≤ d(x,z) + d(y,w) "rectangular inequality" (pos) d(x,y)≥0 "positive"

Author:
André Platzer
`Normed`, `INDUCED`, `Comparator`

Field Summary
`static Metric` `INDUCED`
The metric induced by a norm ||.||.

Method Summary
` Real` ```distance(java.lang.Object x, java.lang.Object y)```
Returns the distance of two objects.

Field Detail

INDUCED

`static final Metric INDUCED`
The metric induced by a norm ||.||.

A norm `||.||` on arithmetic objects induces a metric d:A×A→R; (a,b)↦d(a,b) := ||a-b||.

`Normed`
Method Detail

distance

```Real distance(java.lang.Object x,
java.lang.Object y)```
Returns the distance of two objects.

Returns:
the distance of the objects a and b, or `Double.NaN` if it is symbolic and has no numeric distance.
Postconditions:
RES >= 0 && RES==0 <=> x==y && distance(x,y) == distance(y,x) && distance(x,y) <= distance(x,z) + distance(z,y) && RES≠null

Orbital library
1.3.0: 11 Apr 2009