![]() |
HELP: How do i make Arcsin in MPLAB
Hey
An important question for our team: How do i make arcsin in MPlab, not using a 1 to 180 loop checking every angle and finding the closest one to the value i need? thanks, the Black Knights |
Re: HELP: How do i make Arcsin in MPLAB
Should be in <math.h>.
Code:
#include <math.h> |
Re: HELP: How do i make Arcsin in MPLAB
you could make a lookup table... a large array usually can do the trick. It'll save you the processing power from not using a double, but it'll eat up memory pretty quickly.
|
Re: HELP: How do i make Arcsin in MPLAB
I would try and google arcsin approximation and find one that only involves rational expressions, to limit the amount of floating point math.
|
Re: HELP: How do i make Arcsin in MPLAB
There was a whitepaper on Delphi a couple years ago about CORDIC trig implementations...you should look it up.
|
Re: HELP: How do i make Arcsin in MPLAB
Quote:
|
Re: HELP: How do i make Arcsin in MPLAB
Quote:
I could be wrong about the fact that it's american in origin, but I imagine that's the root of your problem. Paul |
Re: HELP: How do i make Arcsin in MPLAB
If your range of data is within a pretty reasonable small area like (0, pi/2) you could try doing a fifth or sixth degree taylor polynominal instead - it might help with the processing power. then again, if your not performing many other calculations the arctanx function should work fine. (remember it returns radians.)
|
| All times are GMT -5. The time now is 04:54. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi