vec_scale (
VECTOR* vector, var factor)
Multiplies all three numbers of the vector by the given factor.
Parameters:
vector - vector to be scaled.
factor - scale factor
Returns:
vector
Modifies:
vector = vector * factor
Speed:
Fast
Algorithm:
vector[0] *= factor;
vector[1] *= factor;
vector[2] *= factor;
Example:
var v[3] = { 10, 20, 30 };
...
vec_scale(v,5); // v now contains 50, 100, 150
See also:
Vectors, vec_add, vec_sub,
vec_set, vec_inverse,
vec_diff, vec_fill
► latest
version online