Thanks for your answer.
Here's some more information.
I am going through the list of vertices of a segment, stored in a vector of Eigen::Vector2D and then I am computing the distance from a point stored in Eigen::vector2d to a each segment of my polygon.
I calculate the distance using my own function and then I calculate it using boost function distance.
I declare a segment of type boost::geometry::model::segment<double> in which I add my two vertices that make the segment.
Then I display the result for each vertices and I get the same result for every segment using boost.
I hope it's more clear now.