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); } }
public static decimal Cos(decimal angle) { //cosine is just offset sine return(DecimalMath.Sin((DecimalMath.PI / 2.0M) - angle)); }