Math Library compatible with full .NET
January 15th, 2009
8 comments
I’m very busy building my Dare To Dream Different Challenge project. As this is a contest it’s hard to decide what to publish and what not. For my project I need a fair amount of mathematical functions like Sin, Cos, Tan, Exp, etc. These are not implemented, or in the case of Sin and Cos very inaccurate in .NET Micro Framework.
So I started the search how to calculate those functions. I made a class of it. It’s made to be a drop-in replacement for System.Math. I tried to make it as accurate as the full .NET version.
Currently supported functions:
- double Abs(double x)
- Acos(double x)
- Asin(double x)
- Atan(double x)
- Atan2(double y, double x)
- Ceiling(double x)
- Cos(double x)
- Cosh(double x)
- Exp(double x)
- Pow(double x, double y)
- Floor(double x)
- Log(double x)
- Log(double x, double newBase)
- Log10(double x)
- Max(double x, double y)
- Min(double x, double y)
- Sinh(double x)
- Sign(double x)
- Sin(double x)
- Sqrt(double x)
- Tan(double x)
- Tanh(double x)
- Truncate(double x)
You can download the Classfile here: exMath.cs
Recent Comments