vector(var x,var y,var z);

Returns the pointer to a temporary vector initialized to x,y,z, to be used as a parameter in vector functions.

Parameters:

x - copied to 1st vector element.
y - copied to 2nd vector element.
z - copied to 3rd vector element.

Returns:

Pointer to the vector.

Speed:

Fast

Remarks:

The vector pointers have a limited lifetime because there are only 64 different vectors available for this function, that are used cyclic.So use this only for passing temporary vectors to functions, but not for permanent vector pointers.

Example:

vec_set(temp,vector(2,2+2,sqrt(2)));   // sets temp at 2,4,1.414
vec_add(my.x,vector(1,2,3)); // adds 1 to my.x, 2 to my.y, 3 to my.z

See also:

Vectors, vec_set

► latest version online