love.math

Provides system-independent mathematical functions. </b>

Functions

Name Description Notes
isConvex Checks whether a polygon is convex  
newRandomGenerator Creates a new RandomGenerator object  
newTransform Creates a new Transform object  
gammaToLinear Converts a color from gamma-space (sRGB) to linear-space (RGB)  
linearToGamma Converts a color from linear-space (RGB) to gamma-space (sRGB)  
triangulate Decomposes a simple polygon into triangles  
colorToBytes Converts a color from 0 ~ 1 to 0 ~ 255 range  
colorFromBytes Converts a color from 0 ~ 255 to 0 ~ 1 range  
random Get uniformly distributed pseudo-random number  
randomNormal Get a normally distributed pseudo random number  
getRandomState Gets the current state of the random number generator  
getRandomSeed Gets the seed of the random number generator  
setRandomSeed Sets the seed of the random number generator  
setRandomState Sets the current state of the random number generator  

Types

RandomGenerator

A random number generation object which has its own random state. </b>

See also:

Name Description Notes
getSeed Gets the seed of the random number generator  
getState Gets the current state of the random number generator  
randomNormal Get a normally distributed pseudo random number  
setSeed Sets the seed of the random number generator  
setState Sets the current state of the random number generator  
random Generates a pseudo-random number in a platform independent manner  

Transform

Object containing a coordinate system transformation.
The love.graphics module has several functions and function variants which accept Transform objects. </b>

See also:

Name Description Notes
clone Creates a new copy of this Transform  
inverse Creates a new Transform containing the inverse of this Transform  
apply Applies the given other Transform object to this one  
isAffine2DTransform Checks whether the Transform is an affine transformation  
translate Applies a translation to the Transform’s coordinate system  
rotate Applies a rotation to the Transform’s coordinate system  
scale Scales the Transform’s coordinate system  
shear Applies a shear factor (skew) to the Transform’s coordinate system  
reset Resets the Transform to an identity state  
setTransformation Resets the Transform to the specified transformation parameters  
setMatrix Directly sets the Transform’s internal transformation matrix  
getMatrix Gets the internal transformation matrix stored by this Transform  
transformPoint Applies the Transform object’s transformation to the given 2D position  
inverseTransformPoint Applies the reverse of the Transform object’s transformation to the given 2D position