# Power... Math power!

### #1

Posted 16 August 2010 - 05:44 PM

### #2

Posted 16 August 2010 - 06:01 PM

var result = System.Math.Pow(3, 2.5);something like 3^2.5?

### #3

Posted 16 August 2010 - 06:04 PM

Well I should have looked for that secret Math class, I was making one >.<var result = System.Math.Pow(3, 2.5);

### #4

Posted 16 August 2010 - 06:17 PM

- Omar (OZ) likes this

### #5

Posted 16 August 2010 - 06:56 PM

I am working on one!Quick question:

.NET Micro Framework has some great math functions built in, but they are designed for low-power MCUs (so some of them are not as high of precision as their desktop counterparts).

There are .NET MF source code samples out there of high-precision functions. Would you all be interested in an open source high-precision math library. If so, any math experts want to volunteer to help with the implementation? The Netduino hardware can certainly support it.

Chris

I got this so far:

public static int Sin(int angle) { return Microsoft.SPOT.Math.Sin(angle); } public static long Cos(int angle) { return Microsoft.SPOT.Math.Cos(angle); } public static long Abs(long value) { long result; if (value < 0) result = -value; else result = value; return result; } public static double Pow(double num, double exponent) { return System.Math.Pow(num, exponent); } public static double Root(double num, double root) { return Pow(num, (1/root)); } public static double CovertToRange(double v, double inMin, double inMax, double outMin, double outMax) { return outMin + (v - inMin) * (outMax - outMin) / (inMax - inMin); }

I got no comments yet since it isn't done or close to being done

### #6

Posted 16 August 2010 - 11:39 PM

I would certainly be interested - FFT needs itQuick question:

.NET Micro Framework has some great math functions built in, but they are designed for low-power MCUs (so some of them are not as high of precision as their desktop counterparts).

There are .NET MF source code samples out there of high-precision functions. Would you all be interested in an open source high-precision math library. If so, any math experts want to volunteer to help with the implementation? The Netduino hardware can certainly support it.

Chris

### #7

Posted 20 August 2010 - 05:20 PM

- krst likes this

### #8

Posted 22 August 2010 - 02:22 PM

I needed to calculate arctan for a project I am working and that is not automatically available in the microframework so I found this http://www.microfram...-with-full-net/ which worked beautifully.

Here is the math library class file. http://www.microfram.../file/exMath.cs

Works great! Many thanks!

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users