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

19.2.6 distsq

distsq = physics.Vect:distsq(vec)

Parameter

Type

Description

self

in physics.Vect

The input vector

vec

in physics.Vect

The vector used to find the distance squared from self

distsq

out number

The distance squared from self to vec

Returns the distance squared between self and vec. For distance comparison, this routine is faster than physics.Vect:dist.

Introduced in platform.apiLevel = '2.0'