Package org.tinspin.index
Interface RectangleDistanceFunction
-
- All Known Implementing Classes:
RectangleDistanceFunction.FarthestNeighbor,RectangleDistanceFunction.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 RectangleDistanceFunction
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classRectangleDistanceFunction.EdgeDistancestatic classRectangleDistanceFunction.FarthestNeighborSpecial wrapper class which takes the inverse or the given function.static classRectangleDistanceFunction.RectangleDistThis class calculates the distance to a rectangular shaped object.
-
Field Summary
Fields Modifier and Type Field Description static RectangleDistanceFunctionCENTERstatic RectangleDistanceFunctionEDGE
-
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, RectangleEntry<?> 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 RectangleDistanceFunction CENTER
-
EDGE
static final RectangleDistanceFunction 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, RectangleEntry<?> 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 rectangle- Returns:
- distance between point and rectangle
-
centerDistance
static double centerDistance(double[] center, double[] min, double[] max)
-
edgeDistance
static double edgeDistance(double[] center, double[] min, double[] max)
-
-