arcsin(x) added
This commit is contained in:
@@ -11,21 +11,21 @@ internal class Program
|
||||
Console.WriteLine(cc/2);
|
||||
/**/
|
||||
|
||||
|
||||
/*
|
||||
Console.WriteLine(StgSharp.Math.Sin(1.06f));
|
||||
float test = StgSharp.Math.ASin(StgSharp.Math.Sqrt(3.0f) / 2);
|
||||
Console.WriteLine(test);
|
||||
/**/
|
||||
|
||||
/*
|
||||
for (int wasd = 0; wasd < 100; wasd++)
|
||||
{
|
||||
float time = 1000000;
|
||||
double a = 114514;
|
||||
float a = 114514;
|
||||
System.Diagnostics.Stopwatch stopwatch = new Stopwatch();
|
||||
stopwatch.Start(); // 开始监视代码运行时间
|
||||
for (float i = 2; i < time; i++)
|
||||
{
|
||||
a = StgSharp.Math.Tan(i);
|
||||
a = StgSharp.Math.ASin(i/(time/2)-1);
|
||||
}
|
||||
stopwatch.Stop(); // 停止监视
|
||||
TimeSpan timespan = stopwatch.Elapsed; // 获取当前实例测量得出的总时间
|
||||
@@ -37,9 +37,9 @@ internal class Program
|
||||
double b = 114514;
|
||||
double time2 = time;
|
||||
stopwatch1.Start();
|
||||
for (double i = 2; i < time2; i++)
|
||||
for (float i = 2; i < time2; i++)
|
||||
{
|
||||
b = System.Math.Tan(i);
|
||||
b = System.MathF.Asin(i / (time / 2) - 1);
|
||||
}
|
||||
stopwatch1.Stop();
|
||||
timespan = stopwatch1.Elapsed;
|
||||
@@ -49,12 +49,13 @@ internal class Program
|
||||
}
|
||||
/**/
|
||||
|
||||
|
||||
/*
|
||||
double accuracy = 0;
|
||||
for (float i = 1f; i < 4000000; i += 1f)
|
||||
for (float i = -1f; i < 1f; i += 0.000001f)
|
||||
{
|
||||
double r1 = StgSharp.Math.Sin(i);
|
||||
double r2 = System.Math.Sin(i * ( 2 * System.Math.PI) / 360);
|
||||
|
||||
double r1 = StgSharp.Math.ASin(i);
|
||||
double r2 = System.Math.Asin(i)*180/3.1415926;
|
||||
double ac = ( System.Math.Max(r1,r2)- System.Math.Min(r1, r2) ) / r2;
|
||||
if (ac>accuracy)
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -4,6 +4,14 @@
|
||||
<name>StgSharp</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="M:StgSharp.Math.ASin(System.Single)">
|
||||
<summary>
|
||||
Reurns the value of ArcSin(x)
|
||||
</summary>
|
||||
<param name="x"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.ArgumentException"></exception>
|
||||
</member>
|
||||
<member name="M:StgSharp.Math.Log(System.Single)">
|
||||
<summary>
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user