Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Actionscript / April 2005



Tip: Looking for answers? Try searching our database.

Math

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
badmonkey91 - 30 Apr 2005 19:36 GMT
Flash isn't giving me real values when using sine, cosine, ect.   In basic you use # on variables, and I tired Math.abs( ), but didnt help.  Any idea.why(?)
Rothrock - 30 Apr 2005 20:57 GMT
badmonkey91 - 30 Apr 2005 22:07 GMT
er... I mean, when I do Math.cos(ANGLE)  It returns some seemingly random number, that isnt the Cosine of the angle
Rothrock - 30 Apr 2005 22:39 GMT
Ah, that makes sense now.

Yes in Flash you don't give Math.cos an angle you need to give it radians.
Define a variable (or a global variable depending on exactly what you are
doing).

toRadians=Math.PI/180

Then you can use

myCos=Math.cos(angle*toRadians);
Rothrock - 30 Apr 2005 22:40 GMT
I meant to say you don't give it an angle in degrees.
badmonkey91 - 30 Apr 2005 22:51 GMT
thanks a lot =P
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.