123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105 |
- //#define IsTestDownLevel2
- #define IsDriverUpperSec
- #define IsDriverUpperTan
- #define IsDriverUpperCtg
- #define IsDriverUpperLog
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace FunctionSystem
- {
- public static class Level2
- {
- #if IsTestDownLevel2
- #region заглушки
- public static double Sec(double x) => 1;
- public static double Tan(double x) => 1;
- public static double Ctg(double x) => 1;
- public static double Log(double x, double osn) => 1;
- #endregion
- #else
- #if IsDriverUpperSec
- public static double Sec(double x)
- {
- Console.WriteLine($"Cos - {Level1.Cos(x)}");
- return 0;
- }
- #else
-
- public static double Sec(double x)
- {
- return 1 / Level1.Cos(x);
- }
- #endif
- #if IsDriverUpperTan
- public static double Tan(double x)
- {
- Console.WriteLine($"Sin - {Level0.Sin(x)}");
- Console.WriteLine($"Cos - {Level1.Cos(x)}");
- return 0;
- }
- #else
- public static double Tan(double x)
- {
- return Level0.Sin(x) / Level1.Cos(x);
- }
- #endif
- #if IsDriverUpperCtg
- public static double Ctg(double x)
- {
- Console.WriteLine($"Cos - {Level1.Cos(x)}");
- Console.WriteLine($"Sin - {Level0.Sin(x)}");
- return 0;
- }
- #else
- public static double Ctg(double x)
- {
- return Level1.Cos(x) / Level0.Sin(x);
- }
- #endif
- #if IsDriverUpperLog
- public static double Log(double x, double osn)
- {
- Console.WriteLine($"Ln(x) - {Level0.Ln(x)}");
- Console.WriteLine($"Ln({osn}) - {Level0.Ln(osn)}");
- return 0;
- }
- #else
- public static double Log(double x, double osn)
- {
- return Level0.Ln(x) / Level0.Ln(osn);
- }
- #endif
- #endif
- }
- }
|