Esempio n. 1
0
        public static double distance(HCluster clusterA, HCluster clusterB)
        {
            double dist = Math.Pow(clusterA.meanVector.X - clusterB.meanVector.X, 2)
                          + Math.Pow(clusterA.meanVector.Y - clusterB.meanVector.Y, 2)
                          + Math.Pow(clusterA.meanVector.Z - clusterB.meanVector.Z, 2);

            return(Math.Sqrt(dist));
        }
Esempio n. 2
0
 //when clusters are merged, find mean vector of the two before "destoying" the previous cluster
 //no need to run through all inputs again
 internal void UpdateMean(HCluster hCluster)
 {
     meanVector = new Vector3d((meanVector.X + hCluster.meanVector.X) / 2,
                               (meanVector.Y + hCluster.meanVector.Y) / 2,
                               (meanVector.Z + hCluster.meanVector.Z) / 2);
 }
Esempio n. 3
0
 //method used when adding inputs of one cluster to another, to merge them
 public void AddInputs(HCluster clusterToMerge)
 {
     assignedInputs.AddRange(clusterToMerge.assignedInputs);
     assignedMeshes.AddRange(clusterToMerge.assignedMeshes);
 }