CCT.NUI.Core.Clustering.ClusterPrototype.DistanceMetric C# (CSharp) Method

DistanceMetric() public method

public DistanceMetric ( ClusterPrototype otherCluster ) : double
otherCluster ClusterPrototype
return double
        public double DistanceMetric(ClusterPrototype otherCluster) 
        {
            var p1 = Point.FindNearestPoint(this.center, otherCluster.Points);
            var p2 = Point.FindNearestPoint(otherCluster.Center, this.Points);
            return Point.Distance(p1, p2);
        }

Usage Example

Esempio n. 1
0
 private bool IsMergeRequired(ClusterPrototype cluster1, ClusterPrototype cluster2)
 {
     return  cluster1.DistanceMetric(cluster2) < this.settings.MergeMinimumDistanceToCluster ||
             Point.Distance(cluster1.Center, cluster2.Center) < this.settings.MergeMaximumClusterCenterDistances ||
             Point.Distance(cluster1.Center.X, cluster1.Center.Y, cluster2.Center.X, cluster2.Center.Y) < this.settings.MergeMaximumClusterCenterDistances2D;
 }
All Usage Examples Of CCT.NUI.Core.Clustering.ClusterPrototype::DistanceMetric