scale method
Multiply all the components of the vector with a scalar. @param target The vector to save the result in.
Implementation
Vec3 scale(double scalar, [Vec3? target]){
target ??= Vec3();
target.x = scalar * x;
target.y = scalar * y;
target.z = scalar * z;
return target;
}