Skip to main content

distance

Discworld driver help

distance

Name

distance - return the distance between two coordinates

Synopsis

float distance( vector v1, vector v2 );

Description

"vector" is not actually a type in LPC. It is used here to represent an array of ints and/or floats.

distance( v1, v2 ) will return the Euclidean distance between the coordinates signified by `v1' and `v2'.

`v1' and `v2' must be of the same size, otherwise a runtime is produced.

See also

vectors, norm(), dotprod(), angle()