static scalarProjection(vecA, vecB) {
    let unit = vecB.normalized();
    return Vector2.dot(vecA, unit);
  }
Returns the scalar projection of a vector on another vector.

@static
@param {Vector2} vecA The vector to be projected.
@param {Vector2} vecB The vector to be projection upon.
@returns {Number} The scalar component.