time ~ cosine :-(

Discussion in 'Embedded Systems and Microcontrollers' started by onlyvinod56, Nov 26, 2008.

  1. onlyvinod56

    Thread Starter Active Member

    Oct 14, 2008
    362
    1
    hi every one....
    iam from electrical background. I am designing power factor measurement circuit using 89c51. I want to convert the time gap between two consecutive pulses into degrees (angle = 100pi*time). then i have to get the cosine of that angle. my problem is, i didn't find any technique to get cosine of that angle. please help me.
    thanQ.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,152
    1,794
  3. KL7AJ

    AAC Fanatic!

    Nov 4, 2008
    2,040
    287
    Ummmm....isn't that a bit of overkill? How about a TRIG TABLE?


    Eric the minimalist
     
  4. Papabravo

    Expert

    Feb 24, 2006
    10,152
    1,794
    Depending on the number of entries in the table and the available memory you may have to interpolate. I did not say that a polynomial approximation was the only way, but it is a common way, as is table lookup.
     
  5. onlyvinod56

    Thread Starter Active Member

    Oct 14, 2008
    362
    1
    How a calculator operates on sine & cosine functions?
     
  6. Papabravo

    Expert

    Feb 24, 2006
    10,152
    1,794
  7. davebee

    Well-Known Member

    Oct 22, 2008
    539
    46
    Somebody invented routines called cordic algorithms that I've heard some calculators use to generate trigonometric functions, but I couldn't explain them.
     
  8. Papabravo

    Expert

    Feb 24, 2006
    10,152
    1,794
Loading...