qc.Math.distance

Prototype

  • number distance(x1, y1, x2, y2)

Paramters

Paramter Type Description
x1 number
y1 number
x2 number
y2 number
return number The distance between the two sets of coordinates.

Description

Returns the euclidian distance between the two given set of coordinates.

Example

    // return 2.23606797749979
    var ret = game.math.distance(1, 2, 0, 4);