public bool IsRightTriangle() { bool result = true; if (Math.Pow(EdgeAB.Length(), 2.0) + Math.Pow(EdgeBC.Length(), 2.0) != Math.Pow(EdgeCA.Length(), 2.0)) { if (Math.Pow(EdgeBC.Length(), 2.0) + Math.Pow(EdgeCA.Length(), 2.0) != Math.Pow(EdgeAB.Length(), 2.0)) { if (Math.Pow(EdgeCA.Length(), 2.0) + Math.Pow(EdgeAB.Length(), 2.0) != Math.Pow(EdgeBC.Length(), 2.0)) { result = false; } } } return(result); }
//Площадь треугольника по трем сторонам public override double Area() { double semiPerimeter = (EdgeAB.Length() + EdgeBC.Length() + EdgeCA.Length()) / 2.0; return(Math.Sqrt(semiPerimeter * (semiPerimeter - EdgeAB.Length()) * (semiPerimeter - EdgeBC.Length()) * (semiPerimeter - EdgeCA.Length()))); }