From SA-MP Wiki

Jump to: navigation, search

VectorSize was added in SA-MP 0.3z This function was added in SA-MP 0.3z and will not work in earlier versions!


Returns the norm (length) of the provided vector.

(Float:X, Float:Y, Float:Z)
Float:XThe vector's magnitude on the X axis.
Float:YThe vector's magnitude on the Y axis.
Float:ZThe vector's magnitude on the Z axis.

Return Values:

The norm (length) of the provided vector as a float.

Example Usage:

stock Float:GetDistanceBetweenPoints(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2)
    return VectorSize(x1-x2, y1-y2, z1-z2);

Related Functions

The following functions may be useful, as they are related to this function in one way or another.

  • floatsqroot: Calculate the square root of a floating point value.
Personal tools
In other languages