code: private static void scale(double constant, double vector[]) {
          if (constant == 1.0) return;
          for (int i = 0; i < vector.length; i++) {
              vector[i] *= constant;
          }
  
      }
docs: scales a vector by a constant
  
  @since 1.8