Author Topic: Tangent?  (Read 12251 times)

0 Members and 1 Guest are viewing this topic.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Tangent?
« Reply #15 on: May 17, 2012, 04:09:17 pm »
Consider for a second the range of the tangent function.  It ranges from -Infinite to +Infinite, and a large portion of the range is between -1 and 1.  If we were to ignore the *256, and simply take the ratio of Sin(angle)/Cos(angle), our function would return 0 for that portion of the range, as Axe cannot represent fractional numbers.  Obviously this is highly undesirable, so before we divide, we multiply by 256.  This is what is known as 8.8 fixed point notation.  In 8.8 fixed point, 256 is treated as 1, and this way, we can represent fractional numbers.  128 for example would represent 0.5. 

Offline C0deH4cker

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 258
  • Rating: +11/-1
    • View Profile
    • iNinjas Forum/Repo
Re: Tangent?
« Reply #16 on: May 22, 2012, 11:18:26 pm »
Alright, I get it now. Thanks for the explanation. I am not used to working with platforms that do not contain easy to use floating point variables, so fixed-point and other types of arithmetic inflation are new to me.