예제 #1
0
        public static decimal Tan(decimal angle)
        {
            decimal denominator = DecimalMath.Cos(angle);

            if (denominator == 0.0M)
            {
                throw new ArgumentOutOfRangeException(nameof(angle), ErrorMessages.NonZero);
            }
            else
            {
                //tangent is just sine over cosine
                decimal numerator = DecimalMath.Sin(angle);
                return(numerator / denominator);
            }
        }
예제 #2
0
 public static decimal Cos(decimal angle)
 {
     //cosine is just offset sine
     return(DecimalMath.Sin((DecimalMath.PI / 2.0M) - angle));
 }