Пример #1
0
        /// <summary>
        /// Creates a right triangle from its two sides.
        /// </summary>
        /// <param name="lengthA">Length of side A.</param>
        /// <param name="lengthB">Length of side B.</param>
        public static RightTriangleAbstract FromTwoSides(decimal lengthA, decimal lengthB)
        {
            var t = new RightTriangleAbstract
            {
                LengthA    = lengthA,
                LengthB    = lengthB,
                Hypotenuse = RightTriangle.GetHypFromSides(lengthA, lengthB),
                AngleA     = RightTriangle.GetAngleFromSides(lengthB, lengthA),
                AngleB     = RightTriangle.GetAngleFromSides(lengthA, lengthB)
            };

            return(t);
        }