Package org.tinspin.index
Interface BoxDistance
-
- All Known Implementing Classes:
BoxDistance.FarthestNeighbor,BoxDistance.RectangleDist
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface BoxDistance
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classBoxDistance.EdgeDistancestatic classBoxDistance.FarthestNeighborSpecial wrapper class which takes the inverse or the given function.static classBoxDistance.RectangleDistThis class calculates the distance to a rectangular shaped object.
-
Field Summary
Fields Modifier and Type Field Description static BoxDistanceCENTERstatic BoxDistanceEDGE
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static doublecenterDistance(double[] center, double[] min, double[] max)doubledist(double[] point, double[] min, double[] max)default doubledist(double[] center, Index.BoxEntry<?> entry)Some algorithm use this method on the entries containing user supplied values.static doubleedgeDistance(double[] center, double[] min, double[] max)
-
-
-
Field Detail
-
CENTER
static final BoxDistance CENTER
-
EDGE
static final BoxDistance EDGE
-
-
Method Detail
-
dist
double dist(double[] point, double[] min, double[] max)- Parameters:
point- A pointmin- Minimum corner of axis aligned boxmax- Maximum corner of axis aligned box- Returns:
- Distance between point and box
-
dist
default double dist(double[] center, Index.BoxEntry<?> entry)Some algorithm use this method on the entries containing user supplied values. This can be overridden if the min/max coordinates only represent the bounding-box of the object.If your entry is actually a sphere, a car, an human or a cat, you may need this.
- Parameters:
center- a pointentry- a box- Returns:
- distance between point and box
-
centerDistance
static double centerDistance(double[] center, double[] min, double[] max)
-
edgeDistance
static double edgeDistance(double[] center, double[] min, double[] max)
-
-