well I updated my function to allow the line to start anywhere ```cpp auto max_along_dir(std::vector& points, Eigen::VectorXd line_dir, Eigen::VectorXd line_orig) { return std::ranges::max_element(points, {}, [&](const auto& pt) {return (pt-line_orig).dot(line_dir);},); }, ```
since i dont have any external library i coded it like this