Math
Find numeric, random, statistical, and geometric operations.
Feature: Math
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)functionReturns the absolute (positive) integer value of val.
float llAcos(float val)functionReturns the arccosine of val in radians.
float llAngleBetween(rotation start_rot, rotation end_rot)functionReturns the angle, in radians, between rotations start_rot and and end_rot.
float llAsin(float val)functionReturns the arcsine of val in radians.
float llAtan2(float y, float x)functionReturns 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.
rotation llAxes2Rot(vector fwd, vector left, vector up)functionReturns the rotation defined by the coordinate axes fwd, left, and up.
rotation llAxisAngle2Rot(vector axis, float angle)functionReturns the rotation that rotates angle radians around the axis vector.
integer llCeil(float val)functionReturns val rounded toward positive infinity. In other words, returns the smallest integer greater than or equal to val.
float llCos(float theta)functionReturns the cosine of theta. Theta is in radians.
rotation llEuler2Rot(vector vec)functionReturns the quaternion representation of the Euler angles (in radians) within vec.
float llFabs(float val)functionReturns the absolute (positive) value of val.
integer llFloor(float val)functionReturns val rounded toward negative infinity. In other words, returns the largest integer less than or equal to val.
float llFrand(float mag)functionReturns 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.
vector llLinear2sRGB(vector color)functionReturns a sRGB colorspace vector converted from the linear RGB colorspace argument.
float llListStatistics(integer operation, list src)functionReturns the numeric result of the statistical aggregate function operation (a LIST_STAT_* constant) on the numeric list src.
float llLog(float val)functionReturns natural (base e) logarithm of val. If negative, return 0.0.
float llLog10(float val)functionReturns base-10 (common) logarithm of val. If negative, return 0.0.
integer llModPow(integer base, integer exponent, integer modulus)functionReturns 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.
float llPow(float base, float exponent)functionReturns base raised to the power exponent. If result is imaginary, returns NaN.
float llRot2Angle(rotation q)functionReturns the angle, in radians, that q rotates.
vector llRot2Axis(rotation q)functionReturns the unit vector axis that q rotates around.
vector llRot2Euler(rotation q)functionReturns a vector of Euler angles (roll, pitch, yaw) of q. The angles will be in radians.
vector llRot2Fwd(rotation q)functionReturns the unit vector pointing toward positive X (forward) in the coordinate space of rotation q. Equivalent to <1, 0, 0> * q.
vector llRot2Left(rotation q)functionReturns the unit vector pointing toward positive Y (left) in the coordinate space of rotation q. Equivalent to <0, 1, 0> * q.
vector llRot2Up(rotation q)functionReturns the unit vector pointing toward positive Z (up) in the coordinate space of rotation q. Equivalent to <0, 0, 1> * q.
rotation llRotBetween(vector start_vec, vector end_vec)functionReturns the shortest-path quaternion that rotates start_vec onto end_vec.
integer llRound(float val)functionReturns val rounded to the nearest integer. Halfway values are rounded toward infinity.
float llSin(float theta)functionReturns the sine of theta. Theta is in radians.
float llSqrt(float val)functionReturns the square root of val. If negative, return NaN.
float llTan(float theta)functionReturns the tangent of theta. Theta is in radians.
float llVecDist(vector vec_a, vector vec_b)functionReturns a float representing the undirected, non-negative distance between vectors vec_a and vec_b.
float llVecMag(vector vec)functionReturns the magnitude (geometric length) of vec.
vector llVecNorm(vector vec)functionReturns the normalized unit vector pointing the same direction as vec. If <0, 0, 0>, return <0, 0, 0>.
vector llsRGB2Linear(vector color)functionReturns a linear RGB colorspace vector converted from the sRGB colorspace argument.
No matching entries. Try a different term or filter.