Skip to main content
Participant
September 18, 2007
Question

math.cos results undefined

  • September 18, 2007
  • 2 replies
  • 184 views
Any ideas why here below 'what' would give 'undefined' as a result (AS2)?

beta = 1;
what = math.cos(beta);
This topic has been closed for replies.

2 replies

Participant
September 19, 2007
thanks a lot, it is indeed the capitalized 'Math' that does the trick!
clbeech
Inspiring
September 18, 2007
not sure, and it may be a typo, but the Math class should be capitalized, and the input should be in radians:

beta = 1*(Math.PI/180);
what = Math.cos(beta);