math/Vector.php
public function projectOnto(Vector $that) : Vector
    {
        $that = $that->normalize();

        return $that->multiply($this->dotProduct($that));
    }
public function projectOnto(Vector $that) : Vector
    {
        $that = $that->normalize();

        return $that->multiply($this->dotProduct($that));
    }
public function projectOnto ( Vector $ that ) : Vector { $ that = $ that -> normalize ( ) ; return $ that -> multiply ( $ this -> dotProduct ( $ that ) ) ; }
Projects this Vector onto another Vector.

@param   Vector  $that   The vector to project this vector onto.
@return  Vector
Projects this Vector onto another Vector .