Daily update on 20250721-223448 by Nitload Youmu. Additional Message : Rename StgSHarp.C to StgSharp.Native. Add SDL to repo.
Signed-off-by: Nitload <YoumuLiu_NSI@whv0t.onmicrosoft.com>
This commit is contained in:
@@ -28,27 +28,18 @@
|
||||
//
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
public static partial class Scaler
|
||||
{
|
||||
|
||||
[MethodImpl( MethodImplOptions.AggressiveInlining )]
|
||||
public static float Tan( float x )
|
||||
{
|
||||
float refer = x / 360.0f;
|
||||
refer -= ( int )refer;
|
||||
|
||||
refer *= 40;
|
||||
int a = ( int )refer; //大分度,查表
|
||||
refer -= a; //小分度,拟合
|
||||
|
||||
float refer2 = refer * refer;
|
||||
|
||||
float sin = ( 0.1570796327f * refer ) - ( 6.459640975e-4f * refer * refer2 );
|
||||
float cos = ( 1 - ( 0.0123370055f * refer2 ) ) + ( 2.536695709e-5f * refer2 * refer2 );
|
||||
|
||||
return ( ( sinData[ a ] * cos ) + ( cosData[ a ] * sin ) ) / ( ( cosData[ a ] * cos ) - ( sinData[
|
||||
a ] * sin ) );
|
||||
return MathF.Tan( x );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user