fivem-ts

a library to speed up the development of Fivem scripts and frameworks


Project maintained by Purpose-Dev Hosted on GitHub Pages — Theme by mattgraham

fivem-ts - Documentation v0.7.5Docs


fivem-ts - Documentation v0.7.5 / Shared / distance2D

Function: distance2D()

distance2D(x1, y1, x2, y2): number

Calculates the distance between two points in 2D space.

Parameters

x1: number

The x-coordinate of the first point.

y1: number

The y-coordinate of the first point.

x2: number

The x-coordinate of the second point.

y2: number

The y-coordinate of the second point.

Returns

number

The distance between the two points.

Example

distance2D(0, 0, 3, 4); // 5

Defined in

shared/utils/FMath.ts:103