/// <summary> /// 已知三角形三个边用海伦公式计算面积 /// </summary> /// <param name="alength">a边长</param> /// <param name="blength">b边长</param> /// <param name="clength">c边长</param> /// <returns>面积</returns> private double GetHeight(double alength, double blength, double clength) { double S, p; if ((alength + blength > clength) && (alength + clength > blength) && (blength + clength > alength)) { p = (alength + blength + clength) / 2; S = Math.Sqrt(p * (p - alength) * (p - blength) * (p - clength)); } else { S = 0; } return S; }