Skip to content
lsl.devlsl.devLSL Dev

llSin

function
Function syntax
float llSin(
  1. 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.

How to use
float result = llSin(0.0);

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

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));
}
}
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.

From the Second Life Wiki

Community documentation adapted from LlSin, by Linden Research, Inc. and contributing residents.View contributors and history.

Built from these wiki pages, as imported:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.