scale method

Vec3 scale(
  1. double scalar, [
  2. Vec3? target
])

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;
}