Is that possible to put objects in a 2D map using only a matrix of their relative distance ?
An example would be putting cities on a map using the distances between them. There would be a minimum of 4 cities.
Thanks a lot.
|
|
Distance could be enough information to plot 4 cities - but only if you're ok with them ending up in a different configuration every time. For example, if you have city B a distance of 10 cells away from city A, then you can use bresenham's to determine a circle describing all possible locations for city B. If you add city C into the equation (and City C has to be 12 cells away from city B and 8 away from city A), then it gets tricky - you'll have to again use bresenham's to get circles of radius 8 and 12 around cities A and B, and see where those two intersect. There's dozens of possible layouts just for this - the larger the radii, the more there will be. If your cities all have required distances from each other, this gets more complicated as you add more cities. As soon as you add a city D, your layout for cities A B and C isn't guaranteed to accomodate it. If all you have is a single distance requirement (i.e. city D only has to be 15 cells from city C), then it becomes a lot simpler. I hope I didn't overcomplicate this - let me know if I can clarify or elaborate! |
|||
|