This is a "3rd order polynomial ?", and it is used to linearize or compensate a curve. Handheld instrumentation, mostly calibrators, should use several of those polynomials to calculate correct values from a physical sensor, as for example thermocouples. Unfortunately the precision is the king, it will rule all above you. If you want a great precision, will need to have a great table or a great math routine. Math routine is not a big deal, just a multiple byte, lets say 64 to 128 bits is ok. It will require some keyboard work, but you are lucky, it needs only 3 calculation blocks. For certain sensors I already saw more than 12 blocks processed in a 68HC705. Ok, you can be lucky again, as this is just a sine formula, just convince yourself that 5 digits sine value is enough and 628 entries (PI*200) should be enough, so a 1256 table entries can give you a resolution of 0.588¡. Wagner "Phu T. Van" wrote: > > Hi. I've got a problem I don't quite know how to tackle. > I need to program the following function for a 16F84 : > > P(n) = x - (x^3/6) + (x^5/120) - (x^7/5040) > > I don't know what this approximation is called or if it really works the > way it's supposed to. I got it from a local math whiz; supposedly it > will approximate sine of x where x is the angle in radians. > > Anyhow, I need a reliable, fast and efficient way to calculate sine in > realtime to do navigation. I've heard about lookup tables but apparently > that is said to consume a huge amount of memory and processing power. > I'd like to stick with the PIC if possible. > > Any/all inputs appreciated. > > --Phu T. Van