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

CalculateCenter() private method

private CalculateCenter ( ) : void
return void
        private void CalculateCenter()
        {
            if (this.points.Count > 0)
            {
                this.center = this.points[0];
                for (int index = 1; index < this.points.Count; index++)
                {
                    var p = this.points[index];
                    center.X += p.X;
                    center.Y += p.Y;
                    center.Z += p.Z;
                }

                center.X /= this.points.Count;
                center.Y /= this.points.Count;
                center.Z /= this.points.Count;
            }
        }