function
Function syntax
float llSin(float theta// Angle in radians.
);- Returns
float- Energy
- 10
Returns the sine of theta. Theta is in radians.
Returns a float that is the sine of theta.
float result = llSin(0.0);Caveats
Section titled “Caveats”Because of IEE754 on floats , llSin(PI) returns -8.742278E-8 ( hex : 0xB3BBBD2E ) and not 0.0 . The error is cumulative with multiples of PI : For instance llSin(100000.0*PI) = 0.015890 when the result should be 0.0
Examples
Section titled “Examples”Example 1
// Touch the object with this script in it to see the sine of random numbers!default{ touch_start(integer num) { float r = llFrand(TWO_PI); llOwnerSay("The sine of " + (string)r + " in radians or " + (string)(r * RAD_TO_DEG) + " in degrees is " + (string)llSin(r)); }}See also
Section titled “See also”Functions
Section titled “Functions”llAsin— inverse SinellCos—llAcos— cosine & inverse cosinellTan—llAtan2— tangent & inverse tangent
Original wiki source
Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.