|
Jeff Stiglitz
Registered User
Join date: 26 Apr 2006
Posts: 2
|
02-14-2009 08:39
I'm not sure how to describe this properly, but llCos returns the result in radians instead of degrees and I need it in degrees. Here is an example to better explain it.
In Window's scientific calculator, I set the radio buttons to Dec and Degrees. I punch in 270 and hit cos. This gives me 0. Great! Now, I set the radio buttons to Dec and Radians. I punch in 270 and hit cos. Now it gives me .98438. This is exactly what SL is giving me. What is this garbage and how do I convert it to what I need? Thank you for any help.
Example script: llOwnerSay("llCos(270) is: " + (string)llCos(270));
Edit: Yes, I have tried *RAD_TO_DEG and that just makes the number even more useless. I may be using it improperly though.
Example script: llOwnerSay("llCos(270) is: " + (string)(llCos(270)*RAD_TO_DEG));
--Jeff
|
|
Dora Gustafson
Registered User
Join date: 13 Mar 2007
Posts: 779
|
02-14-2009 08:43
use the build in conversion constant' http://lslwiki.net/lslwiki/wakka.php?wakka=RAD_TO_DEGyou must convert the argument to radians as well: llCos(DEG_TO_RAD*270)
_____________________
From Studio Dora
|
|
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
|
02-14-2009 08:48
llCos takes it's argument in radians, not degrees. Your example has 270 , it needs to be 270 * DEG_TO_RAD .
_____________________
-
So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.
I can be found on the web by searching for "SuezanneC Baskerville", or go to
http://www.google.com/profiles/suezanne
-
http://lindenlab.tribe.net/ created on 11/19/03.
Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard, Robin, and Ryan
-
|
|
Jeff Stiglitz
Registered User
Join date: 26 Apr 2006
Posts: 2
|
02-14-2009 08:57
From: SuezanneC Baskerville llCos takes it's argument in radians, not degrees. Your example has 270 , it needs to be 270 * DEG_TO_RAD . Awesome! Thank you so much. I'll have to pay better attention to the function's arguments next time.
|