123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace testing
- {
- internal class FunctionsMath
- {
- public double pow(double a, double pow)
- {
- for (int i = 1; i < pow; i++)
- {
- a *= a;
- }
- return a;
- }
- public struct Trigonometry
- {
- public static double tg(double a) => Math.Sin(a) / cos(a);
- public static double cos(double a)
- {
- if (Math.Sin(a) > 0)
- return Math.Sqrt(1 - (Math.Sin(a) * Math.Sin(a)));
- else
- return -Math.Sqrt(1 - (Math.Sin(a) * Math.Sin(a)));
- }
- public static double sec(double a) => 1 / cos(a);
- public static double cot(double a) => cos(a) / Math.Sin(a);
- }
- public struct Logarifms
- {
- public static double log(double a, double b)
- {
- double res = 0;
- if (a > 0 && a != 1 && b > 0)
- {
- res = Math.Log(b) / Math.Log(a);
- }
- return res;
- }
- }
-
- }
- }
|