Math
Find numeric, random, statistical, and geometric operations.
What do you want to do?
integer llRound(float val)Returns val rounded to the nearest integer. Halfway values are rounded toward infinity.float llFrand(float mag)Returns a pseudo-random float in the range [0.0, mag) or (mag, 0.0] depending on the sign of mag. The value is inclusive of 0.0 but exclusive of mag.float llListStatistics(integer operation, list src)Returns the numeric result of the statistical aggregate function operation (a LIST_STAT_* constant) on the numeric list src.Reference
34 topic entries
integer llAbs(integer val)Returns the absolute (positive) integer value of val.functionfloat llAcos(float val)Returns the arccosine of val in radians.functionfloat llAngleBetween(rotation start_rot, rotation end_rot)Returns the angle, in radians, between rotations start_rot and and end_rot.functionfloat llAsin(float val)Returns the arcsine of val in radians.functionfloat llAtan2(float y, float x)Returns the arctangent of y/x in radians, using the signs to determine the quadrant. Note the argument order: Y is the first parameter, X is the second parameter.functionrotation llAxes2Rot(vector fwd, vector left, vector up)Returns the rotation defined by the coordinate axes fwd, left, and up.functionrotation llAxisAngle2Rot(vector axis, float angle)Returns the rotation that rotates angle radians around the axis vector.functioninteger llCeil(float val)Returns val rounded toward positive infinity. In other words, returns the smallest integer greater than or equal to val.functionfloat llCos(float theta)Returns the cosine of theta. Theta is in radians.functionrotation llEuler2Rot(vector vec)Returns the quaternion representation of the Euler angles (in radians) within vec.functionfloat llFabs(float val)Returns the absolute (positive) value of val.functioninteger llFloor(float val)Returns val rounded toward negative infinity. In other words, returns the largest integer less than or equal to val.functionfloat llFrand(float mag)Returns a pseudo-random float in the range [0.0, mag) or (mag, 0.0] depending on the sign of mag. The value is inclusive of 0.0 but exclusive of mag.functionvector llLinear2sRGB(vector color)Returns a sRGB colorspace vector converted from the linear RGB colorspace argument.functionfloat llListStatistics(integer operation, list src)Returns the numeric result of the statistical aggregate function operation (a LIST_STAT_* constant) on the numeric list src.functionfloat llLog(float val)Returns natural (base e) logarithm of val. If negative, return 0.0.functionfloat llLog10(float val)Returns base-10 (common) logarithm of val. If negative, return 0.0.functioninteger llModPow(integer base, integer exponent, integer modulus)Returns base raised to the power exponent, modulo modulus (i.e., (b^e)%m). All inputs are wrapped to unsigned 32-bit integer range [0..4294967295]. Output is wrapped to signed 32-bit integer range [-2147483648..2147483647]. Will never overflow, unlike (b^e), which can overflow to inf.functionfloat llPow(float base, float exponent)Returns base raised to the power exponent. If result is imaginary, returns NaN.functionfloat llRot2Angle(rotation q)Returns the angle, in radians, that q rotates.functionvector llRot2Axis(rotation q)Returns the unit vector axis that q rotates around.functionvector llRot2Euler(rotation q)Returns a vector of Euler angles (roll, pitch, yaw) of q. The angles will be in radians.functionvector llRot2Fwd(rotation q)Returns the unit vector pointing toward positive X (forward) in the coordinate space of rotation q. Equivalent to <1, 0, 0> * q.functionvector llRot2Left(rotation q)Returns the unit vector pointing toward positive Y (left) in the coordinate space of rotation q. Equivalent to <0, 1, 0> * q.functionvector llRot2Up(rotation q)Returns the unit vector pointing toward positive Z (up) in the coordinate space of rotation q. Equivalent to <0, 0, 1> * q.functionrotation llRotBetween(vector start_vec, vector end_vec)Returns the shortest-path quaternion that rotates start_vec onto end_vec.functioninteger llRound(float val)Returns val rounded to the nearest integer. Halfway values are rounded toward infinity.functionfloat llSin(float theta)Returns the sine of theta. Theta is in radians.functionfloat llSqrt(float val)Returns the square root of val. If negative, return NaN.functionfloat llTan(float theta)Returns the tangent of theta. Theta is in radians.functionfloat llVecDist(vector vec_a, vector vec_b)Returns a float representing the undirected, non-negative distance between vectors vec_a and vec_b.functionfloat llVecMag(vector vec)Returns the magnitude (geometric length) of vec.functionvector llVecNorm(vector vec)Returns the normalized unit vector pointing the same direction as vec. If <0, 0, 0>, return <0, 0, 0>.functionvector llsRGB2Linear(vector color)Returns a linear RGB colorspace vector converted from the sRGB colorspace argument.function
No matching entries. Try a different term or filter.