Distance comparison : 36.6926 / 4.37843
Distance comparison : 19.5823 / 4.37843
Distance comparison : 20.6683 / 4.37843
Distance comparison : -nan / 4.37843 --> two vertices are at the same point
Distance comparison : 12.2823 / 4.37843
_______________________________________________
Boost-users mailing list
Boost...@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users
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.
Thank you very much it works very well now!
I was considering using a ring type at first but I was having a wrong result too.
I was using the append function and then the correct one.
Maybe I was missing something to "close" the polygon?
Actually it was for point inside the polygon so it explains the problem.
But can I access the elements of the polygon if I declare it as ring?
Then I can use the distance between the point and each segment to finally take the smallest value.