Author Topic: How to express the fuction such as sin/cos  (Read 10563 times)

shenzhuo

  • Newbie
  • Posts: 1
  • I'm a llama!
    • View Profile
How to express the fuction such as sin/cos
« on: May 26, 2004, 05:02:32 AM »
How to express the fuction such as sin/cos in TBASIC programming? ??? :'(


Joel Moore

  • Full Member
  • Posts: 128
    • View Profile
Re:How to express the fuction such as sin/cos
« Reply #1 on: May 26, 2004, 03:34:25 PM »
There's nothing built-in but you could use lookup tables.  Some Google searching (try "integer sine cosine") and/or some old computer science textbooks might lead you down the right path.

Here's a newsgroup thread that discusses using lookup tables for this purpose.

People have also mentioned using Taylor Series calculations to generate sine and cosine values but the formula looks pretty complex.

raan

  • Newbie
  • Posts: 31
    • View Profile
Re:How to express the fuction such as sin/cos
« Reply #2 on: June 17, 2004, 11:38:43 AM »
Re:Taylor series
While it is true that the formulation of the taylor series appears complex you don't really need   but a few of the terms to achieve good accuracy  particularily if you are computing over a small interval. You just need to test it out to find how many terms you need to achieve the desired accuracy.