Example #1
0
        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);
        }
Example #2
0
        //Площадь треугольника по трем сторонам
        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())));
        }
Example #3
0
 public bool Intersects(Line2D line)
 {
     return(EdgeAB.SafeIntersect(line) || EdgeBC.SafeIntersect(line) || EdgeCA.SafeIntersect(line));
 }