Jump to content


Photo

Mathematical Functions Need Fixing


  • Please log in to reply
3 replies to this topic

#1 leopardio1

leopardio1

    GMC Member

  • New Member
  • 2 posts
  • Version:Unknown

Posted 12 June 2012 - 07:58 PM

So according to GM Studio, "tan(45)" returns the amount of 1.62 when its supposed to return the result of 1. Is this a bug or have I neglected a common issue :S
  • 0

#2 Mnementh

Mnementh

    15151

  • Retired Staff
  • 6261 posts
  • Version:GM:Studio

Posted 12 June 2012 - 08:13 PM

I'm pretty sure that the trigonometric functions take angles measured in radians. Try "tan(pi/4)".
  • 0

#3 leopardio1

leopardio1

    GMC Member

  • New Member
  • 2 posts
  • Version:Unknown

Posted 12 June 2012 - 08:35 PM

I'm pretty sure that the trigonometric functions take angles measured in radians. Try "tan(pi/4)".


gave a result of 1. so does that mean i should convert my degrees to radians before i input them into the tan function?
  • 0

#4 Kouri

Kouri

    GMC Member

  • GMC Member
  • 157 posts
  • Version:GM:Studio

Posted 12 June 2012 - 08:50 PM


I'm pretty sure that the trigonometric functions take angles measured in radians. Try "tan(pi/4)".


gave a result of 1. so does that mean i should convert my degrees to radians before i input them into the tan function?


That's correct. Luckily, there's a function to do that for you. Your code would look something like:

variable = tan(degtorad(45));

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users