c++ - develop distance matrix using coordinates -


Hey, I have been given a problem, I have basically given a piece of undisclosed grid paper and have to develop it. The distance matrix for each grid point on the page using only coordinates.

I am thinking that the best way would be for some of the least paths like the Floyd-Warshal or Decatur Algorithm pair, but do not know how to adjust the distance to customize it because all documents are pre- Uses - The fixed distance matrix will therefore be gorgeous for any help

Just the other in the distance matrix Distance is the distance.

Basically, you just have to calculate the distance using a suitable metric. If you want a "normal" distance, then it is sqrt ((x1-x2) ^ 2 + (y1-y2) ^ 2) where (x / y) are coordinates of a point in mm / inch if you only distance the paper Want your lines after X1-x2 + | Y1-y2 Graph algorithm will be an Overkill until you have a wall on paper.


Comments