private void btnTest1_Click(object sender, EventArgs e) { //顶点 double ax = 116.310023162215; double ay = 39.6077930104616; double bx = 16.429006036412; double by = 39.9080152152481; double cx = 116.430023162215; double cy = 39.9077930104616; //3个边的长 double ab = GetDistance(ax,ay, bx, by); double ac = GetDistance(ax, ay, cx, cy); double bc = GetDistance(bx, by, cx, cy); //半周长 double p = (ab + ac + bc) / 2; //面积(海仑公式) double s = Math.Sqrt(p * (p - ab) * (p - ac) * (p - bc)); //高 double h = 2 * s / bc; MessageBox.Show(h.ToString()); } private double GetDistance(double A_x, double A_y, double B_x, double B_y) { double x = System.Math.Abs(B_x - A_x); double y = System.Math.Abs(B_y - A_y); return Math.Sqrt(x * x + y * y); } 其中GetDistance函数摘自"水滴石穿"blog"C#中求两点间距离"一文,本例中对参数类型稍做改动