Class SquareEuclideanDistanceFunction
A distance function for our KD-Tree which returns squared euclidean distances.
Inheritance
System.Object
SquareEuclideanDistanceFunction
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace:KDTree
Assembly:cs.temp.dll.dll
Syntax
public class SquareEuclideanDistanceFunction : DistanceFunctions
Methods
Distance(Double[], Double[])
Find the squared distance between two n-dimensional points.
Declaration
public double Distance(double[] p1, double[] p2)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | p1 | The first point. |
System.Double[] | p2 | The second point. |
Returns
Type | Description |
---|---|
System.Double | The n-dimensional squared distance. |
Implements
DistanceToRectangle(Double[], Double[], Double[])
Find the shortest distance from a point to an axis aligned rectangle in n-dimensional space.
Declaration
public double DistanceToRectangle(double[] point, double[] min, double[] max)
Parameters
Type | Name | Description |
---|---|---|
System.Double[] | point | The point of interest. |
System.Double[] | min | The minimum coordinate of the rectangle. |
System.Double[] | max | The maximum coorindate of the rectangle. |
Returns
Type | Description |
---|---|
System.Double | The shortest squared n-dimensional squared distance between the point and rectangle. |