code: public function multiplyByScalar($scalar)
      {
          $result = [];
          foreach ($this->components() as $i => $component) {
              $result[$i] = $component * $scalar;
          }
  
          return new static($result);
      }
docs: Multiplies the vector by the given scalar.
  
  @api
  @param int|float $scalar The real number to multiply by.
  @return self The result of the multiplication.