Esempio n. 1
0
        /// <summary>
        /// Creates a right triangle from one side and the hypotenuse.
        /// This side is treated as side A.
        /// </summary>
        /// <param name="lengthA">Length of side A.</param>
        /// <param name="hypotenuse">Length of the hypotenuse.</param>
        public static RightTriangleAbstract FromSideAHypotenuse(decimal lengthA, decimal hypotenuse)
        {
            var t = new RightTriangleAbstract
            {
                LengthA    = lengthA,
                Hypotenuse = hypotenuse,
                LengthB    = RightTriangle.GetSideFromSideHyp(lengthA, hypotenuse),
                AngleA     = RightTriangle.GetAngleFromAdjSideHyp(lengthA, hypotenuse),
                AngleB     = RightTriangle.GetAngleFromOppSideHyp(lengthA, hypotenuse)
            };

            return(t);
        }