Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Double prescision math lib?


  • Please log in to reply
38 replies to this topic

#1 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 20 September 2010 - 05:28 PM

Hey Chris: Any plans for a double precision math lib for the Netduino? I have a project that I am strongly thinking of porting over, but it does require trig, and inverse trig functions. NETMF's int precision library isn't gonna do it.

#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 20 September 2010 - 06:36 PM

Hi Chris,

Other community members have been using this math library (source) from Elze Kool.

Does that meet your needs, or do you need something beyond that? If more, please let us know what you need exactly...we could certainly make it.

Chris

#3 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 20 September 2010 - 07:16 PM

Hi Chris, Thanks for that link. I have been looking for his lib for a long time, but I couldn't remember for the life of me the project link. Google wasn't a big help either, since I only remembered the generic "MathEx" class name. I'll look at his lib and get back to you if I need any =thing outside of it.

#4 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 24 September 2010 - 06:11 PM

Hi Chris, Is there any way you guys might think about doing a native solution? We need an extremely fast lib. Having it in managed code might be too wasteful.

#5 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 24 September 2010 - 06:18 PM

Is there any way you guys might think about doing a native solution? We need an extremely fast lib. Having it in managed code might be too wasteful.


That's certainly a possibility. Any other community members interested in this (using, helping implement, etc.)?

#6 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 24 September 2010 - 06:21 PM

I can probably write the lib, but I don't think I have a proper build envo. I'll have to look into the requirements to compile the Netduino firmware.

#7 greg

greg

    Advanced Member

  • Members
  • PipPipPip
  • 169 posts
  • LocationChicago, IL

Posted 24 September 2010 - 06:22 PM

I can probably write the lib, but I don't think I have a proper build envo. I'll have to look into the requirements to compile the Netduino firmware.


You can compile it under GCC and then let Chris and his minions recompile under RVDS or whatever it is that they use.

#8 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 24 September 2010 - 07:44 PM

^^^ That's what I was thinking...

#9 Mark H

Mark H

    Advanced Member

  • Members
  • PipPipPip
  • 70 posts
  • LocationPerth, Western Australia

Posted 25 September 2010 - 01:23 AM

I too would like a native solution for this :) Like Chris S, i don't have the tool chain for compiling for Atmel ARM :(

#10 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 26 September 2010 - 10:31 PM

Fancy seeing you here, Mark.

#11 CodeRage

CodeRage

    New Member

  • Members
  • Pip
  • 8 posts

Posted 23 April 2011 - 07:26 PM

Is this still being pursued? single precision float sin/cos/atan are critical to my project and I cant find them any where. Or is it available and I am looking in the wrong places?

#12 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 23 April 2011 - 11:44 PM

There is a math "lib" out there that just exposes the internal math functions. I could've sworn I was told it would make it in to the official release, and that was a while ago.

#13 CodeRage

CodeRage

    New Member

  • Members
  • Pip
  • 8 posts

Posted 24 April 2011 - 01:01 AM

Thanks for the reply Chris! Well, I am using exMath now but I imagine it is going to be much much slower. There is no System.Math and the Microsoft.SPOT.NET.Math only has a few integer based components. Nothing in SecretLabs.* Where else would it be?

#14 KodeDaemon

KodeDaemon

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 27 April 2011 - 02:23 AM

I posted firmware builds of my math library to the forums. There seemed to be a huge lack of interest so I did not pursue it any further.

#15 Chris Seto

Chris Seto

    Advanced Member

  • Members
  • PipPipPip
  • 405 posts

Posted 27 April 2011 - 10:05 AM

Honestly, I'd hope that sooner or later a standard set of math functions make it to the official NETMF release.. The existing methods are kinda janky and could be removed/replaced with the new set.

#16 Michel Trahan

Michel Trahan

    Advanced Member

  • Members
  • PipPipPip
  • 155 posts

Posted 27 April 2011 - 11:52 AM

I posted firmware builds of my math library to the forums. There seemed to be a huge lack of interest so I did not pursue it any further.

That was before I got a netduino :) It would be useful to have one ...
Started with C in 1985, moved to Vb3 ... to vb6 and stopped. Now started with .Net and learning C# and VB.net and wishing VB.net was on MF !

#17 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 27 April 2011 - 03:03 PM

We added the exMath trigonometry library to the netduino.helpers library: http://netduinohelpers.codeplex.com/
That said, a native implementation certainly would be handy.

#18 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 27 April 2011 - 03:49 PM

We added the exMath trigonometry library to the netduino.helpers library: http://netduinohelpers.codeplex.com/

I have done some work on that functions a time ago, because there are many points unclear. For example, the using of doubles and floats together. On a Netduino platform, I guess the doubles should be taken only for extreme solutions, not for common math.
Over that, I have tested the square root function but it is absolutely off even for a fast PC: it converges too slowly for large numbers. I have published another solution that would be appreciable for Netduino users.

That said, a native implementation certainly would be handy.

Absolutely true!
As far I will have some spare time, I may take in charge some algorithm using C#. I cannot provide any native implementation due the impossibility to compile the MF.

Cheers
Biggest fault of Netduino? It runs by electricity.

#19 KodeDaemon

KodeDaemon

    Advanced Member

  • Members
  • PipPipPip
  • 63 posts

Posted 27 April 2011 - 05:04 PM

I have to ask, it seems like there are a lot of people largely interested in a native version of the math functions, is there something wrong with mine that it isn't good enough for you to use in the meantime?

#20 Fabien Royer

Fabien Royer

    Advanced Member

  • Members
  • PipPipPip
  • 406 posts
  • LocationRedmond, WA

Posted 27 April 2011 - 08:50 PM

is there something wrong with mine that it isn't good enough for you to use in the meantime?


I was not aware that you wrote one. Got a link? Does it require reflashing the netduino with a custom firmware?

-Fabien.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.