TMath
1.0.0
Tmath는 INumber<T> 구현하는 모든 숫자 또는 사용자 정의 유형에 대한 기능 구현이있는 C# Math 라이브러리입니다. 일부 기능에는 ILogarithmicFunctions<T> 또는 IPowerFunctions<T> 와 같은 다른 구현이 필요합니다.
INumber<T> 구현하는 한 float , ulong , decimal 또는 사용자 정의 숫자 유형을 사용하는 경우에는 중요하지 않습니다.TConstants<T> 상수를 Euler 's Number, PI, Golden Ratio 및 Common SquarFactorial() 과 같은 제네릭과도 작동하는 기본 Math 클래스에서 지원하지 않는 더 많은 수학 기능.INumber<T> Easings Class : TEasingsDescriptiveStatistics 클래스를 사용하여 데이터 세트에 대한 모든 정보를 보유합니다. 프로젝트에 TMATH를 설치하는 여러 가지 방법이 있습니다.
dotnet add package TMath중요한
파일을 수동으로 다운로드하면 패키지가 업데이트 될 때마다 최신 릴리스를 원할 경우 패키지를 수동으로 업데이트해야합니다.
tmath를 사용하는 것은 매우 간단합니다. Math 와 같은 기능을 호출하면 Factorial<T>() 와 같은 소수의 기능을 제외하고 대부분의 기능에 대한 올바른 유형을 자동으로 반환합니다.
TConstants<T> 사용하여 상수를 얻으려면 유형을 지정하십시오 (예 : TConstants<float> ).
// Calculating the area of a circle arc.
decimal angle = TConstants < decimal > . Pi ;
decimal radius = 1 ;
decimal areaOfArc = ( TFunctions . Rad2Deg ( angle ) / 360 ) * TConstants < decimal > . Pi * TFunctions . Pow ( radius , 2 ) ;
Console . WriteLine ( areaOfArc ) ;
// Calculating 20!
long factorial = TFunctions . Factorial < long > ( 20 ) ;
Console . WriteLine ( factorial ) ;
// Absolute value
sbyte number = - 34 ;
sbyte abs = TFunctions . Abs ( number ) ;
Console . WriteLine ( abs ) ;
// Getting the info about a data set
float [ ] data = new float [ ] { 1 , 2 , 3 , 4 , 5 , 6 }
float mean = TStatistics . Mean ( data ) ;
DescriptiveStatistics statistics = new ( data ) ; // Or get all that info computed into the custom class
Console . WriteLine ( statistics ) ; 어쨌든 기여하고 싶다면 기여 방법에 대한 정보는 기고 가이드 라인을 확인하십시오.
TMATH는 MIT 라이센스에 따라 라이센스가 부여됩니다.