Vec2:length

Returns the length of the vector.

length = Vec2:length()

Arguments

None

Returns

NameTypeDescription
lengthnumberThe length of the vector.

Notes

The length is equivalent to this:

math.sqrt(v.x * v.x + v.y * v.y)

See also