/// <summary> /// Delaunay三角网整体边长平均值(全局) /// </summary> /// <param name="tin"></param> /// <returns></returns> private double GlobalMean(ITin tin) { double length = 0; ITinAdvanced tinAdvanced = tin as ITinAdvanced; int edgeCount = tinAdvanced.EdgeCount; for (int i = 1; i <= edgeCount; i++) { if (tinAdvanced.GetEdge(i).IsInsideDataArea) { length = length + tinAdvanced.GetEdge(i).Length; } } return(length / (double)tinAdvanced.DataEdgeCount); }
/// <summary> /// 整体边长标准差(全局) /// </summary> /// <param name="tin"></param> /// <param name="globalMean"></param> /// <returns></returns> private double GlobalStDev(ITin tin, double globalMean) { double a = 0; ITinAdvanced tinAdvanced = tin as ITinAdvanced; int edgeCount = tinAdvanced.EdgeCount; // int edgeCount = tinAdvanced.DataEdgeCount; for (int i = 1; i <= edgeCount; i++) { if (tinAdvanced.GetEdge(i).IsInsideDataArea) { ITinEdge tinEdge = tinAdvanced.GetEdge(i); a = a + (globalMean - tinEdge.Length) * (globalMean - tinEdge.Length); } } return(System.Math.Sqrt(a / (double)tinAdvanced.DataEdgeCount)); }