math.length

Computes the length of a 2D vector.

Usage

math.length(x, y)

Arguments

Name Type Description
x number X coordinate of the vector.
y number Y coordinate of the vector.

Returns

Name Type Description
length number Vector length.

Examples

local d = math.length(0, 5);
print(d); -- Prints "5"

This site uses Just the Docs, a documentation theme for Jekyll.