How to calculate tan angles..

*"add '***math.h**' lib"

Note that math.h isa library - it is just a header file!*not*

In addition to**#include**-ing math.h, you will also have to add the appropriate floating-point lirary/libraries to your project.

For details, see the**documentation**for your particular toolset.

Note that some free/restricted toolset versions may not allow use of floating point- Note that floating-point has a
significantly greater overhead (both code size and execution time) than integer maths - therefore you should think very carefully indeed whether you*very*need floating point in your application.*really*

This is one reason why many (most?) embedded toolchains do not include floating-point by default.

In most cases, it is easy enough to scale you values so that you can do everything in integer maths; eg, instead of processing 3.3V as a floating-point number, think of it as 3300mV - an integer!

You can choose any scaling factor that is convenient to your particular application.

Functions such as**tan()**can be implemented as lookup tables, or integer implementations - so-called "fixed point" - are available.

eg, CORDIC algorithms: http://en.wikipedia.org/wiki/CORDIC

So, try it first using floating-point; but be aware that this may give you code-size and/or performance issues - so be prepared to explore the alternatives... - Integer vs. floating point makes a BIG difference in execution time. My DTMF decode went from 10 milliseconds to 0.6 milliseconds.

This was for a 100 sample Goertzel algorithm performing sums and power calculation using integer arithmetic returning a signed 64-bit integer. I used 16 different frequencies -- the basic 8(*) and their second harmonics. C code converted that to 32-bit fp. Column/row selection used fp to pick a winner that had to be 3x the sum of the other three items. Sum of all 8 harmonics had to be a factor of 3 or 4 less than the winning row value.

(*) that included the almost never present ABCD column to the right of 369#.

math.h"lib and use tan(x) function.