Package org.apache.lucene.spatial3d.geom
Class NormalSquaredDistance
java.lang.Object
org.apache.lucene.spatial3d.geom.NormalSquaredDistance
- All Implemented Interfaces:
DistanceStyle
Normal squared distance computation style.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Field Summary
FieldsFields inherited from interface org.apache.lucene.spatial3d.geom.DistanceStyle
ARC, LINEAR, LINEAR_SQUARED, NORMAL, NORMAL_SQUARED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecomputeDistance(GeoPoint point1, double x2, double y2, double z2) Compute the distance from a point to another point.doublecomputeDistance(GeoPoint point1, GeoPoint point2) Compute the distance from a point to another point.doublecomputeDistance(PlanetModel planetModel, Plane plane, double x, double y, double z, Membership... bounds) Compute the distance from a plane to a point.doublecomputeDistance(PlanetModel planetModel, Plane plane, GeoPoint point, Membership... bounds) Compute the distance from a plane to a point.GeoPoint[]findDistancePoints(PlanetModel planetModel, double distanceValue, GeoPoint startPoint, Plane plane, Membership... bounds) Find a GeoPoint, at a specified distance from a starting point, within the specified bounds.doublefindMaximumArcDistance(PlanetModel planetModel, double distanceValue) Given a distance metric, find the maximum arc distance represented by the distance metric.doublefindMinimumArcDistance(PlanetModel planetModel, double distanceValue) Given a distance metric, find the minimum arc distance represented by that distance metric.doublefromAggregationForm(double aggregateDistance) Convert an aggregation form distance value back to an actual distance.doubletoAggregationForm(double distance) Convert a distance to a form meant for aggregation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.spatial3d.geom.DistanceStyle
aggregateDistances
-
Field Details
-
INSTANCE
A convenient instance
-
-
Constructor Details
-
NormalSquaredDistance
public NormalSquaredDistance()Constructor.
-
-
Method Details
-
computeDistance
Description copied from interface:DistanceStyleCompute the distance from a point to another point.- Specified by:
computeDistancein interfaceDistanceStyle- Parameters:
point1- Starting pointpoint2- Final point- Returns:
- the distance
-
computeDistance
Description copied from interface:DistanceStyleCompute the distance from a point to another point.- Specified by:
computeDistancein interfaceDistanceStyle- Parameters:
point1- Starting pointx2- Final point xy2- Final point yz2- Final point z- Returns:
- the distance
-
computeDistance
public double computeDistance(PlanetModel planetModel, Plane plane, GeoPoint point, Membership... bounds) Description copied from interface:DistanceStyleCompute the distance from a plane to a point.- Specified by:
computeDistancein interfaceDistanceStyle- Parameters:
planetModel- The planet modelplane- The planepoint- The pointbounds- are the plane bounds- Returns:
- the distance
-
computeDistance
public double computeDistance(PlanetModel planetModel, Plane plane, double x, double y, double z, Membership... bounds) Description copied from interface:DistanceStyleCompute the distance from a plane to a point.- Specified by:
computeDistancein interfaceDistanceStyle- Parameters:
planetModel- The planet modelplane- The planex- The point xy- The point yz- The point zbounds- are the plane bounds- Returns:
- the distance
-
toAggregationForm
public double toAggregationForm(double distance) Description copied from interface:DistanceStyleConvert a distance to a form meant for aggregation. This is meant to be used in conjunction with aggregateDistances() and fromAggregationForm(). Distances should be converted to aggregation form before aggregation is attempted, and they should be converted back from aggregation form to yield a final result.- Specified by:
toAggregationFormin interfaceDistanceStyle- Parameters:
distance- is an output of computeDistance().- Returns:
- the distance, converted to aggregation form.
-
fromAggregationForm
public double fromAggregationForm(double aggregateDistance) Description copied from interface:DistanceStyleConvert an aggregation form distance value back to an actual distance. This is meant to be used in conjunction with toAggregationForm() and aggregateDistances(). Distances should be converted to aggregation form before aggregation is attempted, and they should be converted back from aggregation form to yield a final result.- Specified by:
fromAggregationFormin interfaceDistanceStyle- Parameters:
aggregateDistance- is the aggregate form of the distance.- Returns:
- the combined distance.
-
findDistancePoints
public GeoPoint[] findDistancePoints(PlanetModel planetModel, double distanceValue, GeoPoint startPoint, Plane plane, Membership... bounds) Description copied from interface:DistanceStyleFind a GeoPoint, at a specified distance from a starting point, within the specified bounds. The GeoPoint must be in the specified plane.- Specified by:
findDistancePointsin interfaceDistanceStyle- Parameters:
planetModel- is the planet model.distanceValue- is the distance to set the new point at, measured from point1 and on the way to point2.startPoint- is the starting point.plane- is the plane that the point must be in.bounds- are the constraints on where the point can be found.- Returns:
- zero, one, or two points at the proper distance from startPoint.
-
findMinimumArcDistance
Description copied from interface:DistanceStyleGiven a distance metric, find the minimum arc distance represented by that distance metric.- Specified by:
findMinimumArcDistancein interfaceDistanceStyle- Parameters:
planetModel- is the planet model.distanceValue- is the distance metric.- Returns:
- the minimum arc distance that that distance value can represent given the planet model.
-
findMaximumArcDistance
Description copied from interface:DistanceStyleGiven a distance metric, find the maximum arc distance represented by the distance metric.- Specified by:
findMaximumArcDistancein interfaceDistanceStyle- Parameters:
planetModel- is the planet model.distanceValue- is the distance metric.- Returns:
- the maximum arc distance that that distance value can represent given the planet model.
-