Skip to content

melon.math

garryspins edited this page Feb 27, 2026 · 4 revisions

melon.math


shared link

Misc math functions
melon

Functions

melon.math.distance

shared link
melon.math.distance(x: number, y: number)

Argument and Return information

Arguments

# Name Type Description
1 x number X Coordinate
2 y number Y Coordinate

Gets the distance between x and y

melon.math.max

shared link
melon.math.max(tbl: table, key?: any) -> number

Argument and Return information

Arguments

# Name Type Description
1 tbl table Table to get the max of
2 key? any Check a specific key if valid, otherwise all, seems useless

Returns

# Name Type Description
1 max number Max value from the table

math.max on all table elements

melon.math.min

shared link
melon.math.min(tbl: table, key?: any) -> number

Argument and Return information

Arguments

# Name Type Description
1 tbl table Table to get the min of
2 key? any Check a specific key if valid, otherwise all, seems useless

Returns

# Name Type Description
1 max number Min value from the table

math.min on all table elements

melon.math.sum

shared link
melon.math.sum(table: table) -> number

Argument and Return information

Arguments

# Name Type Description
1 table table Table to get the sum of

Returns

# Name Type Description
1 sum number Sum of all the tables contents

Gets the sum of an entire table

Clone this wiki locally