Skip to content

format

typescript
Vector4.Distance(lhs, rhs)

class: Vector4

description

Calculates the straight-line distance between two vectors.

parameter

param_nametypedescription
lhsVector4The lhs vector.
rhsVector4The rhs vector.

return

typedescription
numberThe distance between lhs and rhs.

code example

typescript
let lhs = new Vector4(1, 2, 3, 4);
let rhs = new Vector4(4, 6, 1, 2);
Debug.Log(Vector4.Distance(lhs, rhs));