VectorLength

From ZDoom Wiki
Jump to navigation Jump to search

int VectorLength (int x, int y)

Usage

Returns the length of the vector (x,y).

Parameters

  • x, y: Coordinates of the end point of the vector.

Return value

Length of the vector (x,y).

Examples

Here is a quick example to use it with three dimensions:

function int VLength3d(int x, int y, int z)
{
	int len = VectorLength(x, y);
	len = VectorLength(z, len);
	return len;
}

See Also

  • distance (Similar function for versions older than r3883.)