Jump to content

math library on msp430

Recommended Posts

Hi all,


for one of my project i need to use sin, cos, sqrt, atan2 functions from the math library. When i'am using atan2 function, everything goes fine, but when i try to use sin, cos or sqrt, the compiler says it cannot allocate the bss segement (ram). Does any of you know an alternative to the math library with a small footprint ? I have implemented sin, cos and sqrt my way, but cos and sin seems to suffer from precision problems (taylors series).



Link to post
Share on other sites

Thanks for the link, i'am gonna check it.

i'am using these functions to cimpute distance between too set of gps coordinates. The distance computation is fine for long distance but for short distance, the function underestimate the distance. For example for a 8.6km distance i get 5.6km. The point is that for a short distance like 600m i get 480m ... it seems that the error is not linear or happens for some specific values. This precision is sufficient for my application but i'd like to understand the problem.

Link to post
Share on other sites

i found my problem, and the problem is ... me ! I used haversine function on angle in degree decimal-minute while it should take angle in decimal degree ... Everything is working fine and my implementation gives an error of ~10m compared to an implementation using math.h with double type.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...