Evaluating trigonometric functions in programming pic c

Discussion in 'Embedded Systems and Microcontrollers' started by mugunthanselvaraj, Jan 3, 2009.

  1. mugunthanselvaraj

    Thread Starter New Member

    Mar 28, 2008
    In programming pic microcontrollers how can we evalute some trignometric functions like arccos(x). Can we use any mathematical series like taylor series to evaluate ? are there are any other better methods to evalute to get most aproximate values?
  2. jpanhalt


    Jan 18, 2008
  3. steveb

    Senior Member

    Jul 3, 2008
    Often, the most efficient method is to use lookup tables, assuming you have enough memory to store the tables. You need to carefully determine what your required precision is and how much memory you can devote to the lookup tables. There are efficient methods of indexing the memory to instantly find the function value for a given input, without a search algorithm. Often linear interpolation is used to improve accuracy or limit the size of the table. It is possible to implement linear interpolation without a division operations, which is preferred since division uses much CPU time.