You are here: Lua Scripting Resources eGuide > Lua Scripting API Reference Guide > Physics Library > lengthsq

19.2.10 lengthsq

lensq = physics.Vect:lengthsq()

Parameter

Type

Description

self

in physics.Vect

The input vector

lensq

out number

The length squared of vector self

Returns the length squared of self. This routine is faster than Vect:length() when you only need to compare lengths.

Introduced in platform.apiLevel = '2.0'