Show raw api
{
"functions": [
{
"name": "map",
"desc": "Maps a number from one range to another.\n\n:::note\nNote the mapped value can be outside of the initial range,\nwhich is very useful for linear interpolation.\n:::\n\n```lua\nprint(Math.map(0.1, 0, 1, 1, 0)) --> 0.9\n```",
"params": [
{
"name": "num",
"desc": "",
"lua_type": "number"
},
{
"name": "min0",
"desc": "",
"lua_type": "number"
},
{
"name": "max0",
"desc": "",
"lua_type": "number"
},
{
"name": "min1",
"desc": "",
"lua_type": "number"
},
{
"name": "max1",
"desc": "",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "number"
}
],
"function_type": "static",
"source": {
"line": 27,
"path": "src/math/src/Shared/Math.lua"
}
},
{
"name": "jitter",
"desc": "Returns jittered value at the average value, with the spread being\nrandom.",
"params": [
{
"name": "average",
"desc": "",
"lua_type": "number"
},
{
"name": "spread",
"desc": "Defaults to 50% of the average number which is pretty standard for industry",
"lua_type": "number?"
},
{
"name": "randomValue",
"desc": "",
"lua_type": "number?"
}
],
"returns": [
{
"desc": "",
"lua_type": "number"
}
],
"function_type": "static",
"source": {
"line": 44,
"path": "src/math/src/Shared/Math.lua"
}
},
{
"name": "isNaN",
"desc": "Returns true if a number is NaN",
"params": [
{
"name": "num",
"desc": "",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "static",
"source": {
"line": 56,
"path": "src/math/src/Shared/Math.lua"
}
},
{
"name": "isFinite",
"desc": "Returns true if a number is finite",
"params": [
{
"name": "num",
"desc": "",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean"
}
],
"function_type": "static",
"source": {
"line": 65,
"path": "src/math/src/Shared/Math.lua"
}
},
{
"name": "lerp",
"desc": "Interpolates betweeen two numbers, given an percent. The percent is\na number in the range that will be used to define how interpolated\nit is between num0 and num1.\n\n```lua\nprint(Math.lerp(-1000, 1000, 0.75)) --> 500\n```",
"params": [
{
"name": "num0",
"desc": "Number",
"lua_type": "number"
},
{
"name": "num1",
"desc": "Second number",
"lua_type": "number"
},
{
"name": "percent",
"desc": "The percent",
"lua_type": "number"
}
],
"returns": [
{
"desc": "The interpolated",
"lua_type": "number"
}
],
"function_type": "static",
"source": {
"line": 83,
"path": "src/math/src/Shared/Math.lua"
}
},
{
"name": "lawOfCosines",
"desc": "Solving for angle across from c",
"params": [
{
"name": "a",
"desc": "",
"lua_type": "number"
},
{
"name": "b",
"desc": "",
"lua_type": "number"
},
{
"name": "c",
"desc": "",
"lua_type": "number"
}
],
"returns": [
{
"desc": "Returns nil if this cannot be solved for",
"lua_type": "number?"
}
],
"function_type": "static",
"source": {
"line": 95,
"path": "src/math/src/Shared/Math.lua"
}
},
{
"name": "round",
"desc": "Round the given number to given precision\n\n```lua\nprint(Math.round(72.1, 5)) --> 75\n```",
"params": [
{
"name": "number",
"desc": "",
"lua_type": "number"
},
{
"name": "precision",
"desc": "Defaults to 1",
"lua_type": "number?"
}
],
"returns": [
{
"desc": "",
"lua_type": "number"
}
],
"function_type": "static",
"source": {
"line": 115,
"path": "src/math/src/Shared/Math.lua"
}
},
{
"name": "roundUp",
"desc": "Rounds up to the given precision",
"params": [
{
"name": "number",
"desc": "",
"lua_type": "number"
},
{
"name": "precision",
"desc": "",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "number"
}
],
"function_type": "static",
"source": {
"line": 130,
"path": "src/math/src/Shared/Math.lua"
}
},
{
"name": "roundDown",
"desc": "Rounds down to the given precision",
"params": [
{
"name": "number",
"desc": "",
"lua_type": "number"
},
{
"name": "precision",
"desc": "",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "number"
}
],
"function_type": "static",
"source": {
"line": 141,
"path": "src/math/src/Shared/Math.lua"
}
}
],
"properties": [],
"types": [],
"name": "Math",
"desc": "Holds utilty math functions not available on Roblox's math library.",
"source": {
"line": 5,
"path": "src/math/src/Shared/Math.lua"
}
}