Macha Posted January 12, 2010 Share Posted January 12, 2010 (edited) I'm clearly out of my depth here, but if there does or does not exist a solution for this I'd be glad to know. I wonder if there is a metric for something like in the picture below. I am interested in the distance from one point to another (by travelling along the lines). If it is a simple grid then the answer is easy: |x2-x1| + |y2-y1| + |z2-z1| But what if there is a more messy topology? Is there a solution for this? Edited January 12, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
0rr Posted January 12, 2010 Share Posted January 12, 2010 (edited) I am not a genius and maybe I misunderstood your question. But you could just calulate a Vector from one point to another from p1 to p2 that would be d=p2-p1 and then just calucalte the vectors length. If you want to go from p1 to p3 over p2 then just add the vectors lenght len(p2-p1) + len(p3-p2). I just noticed you were talking about Metrics ... so forget about what I have just written ;D Edited January 12, 2010 by 0rr Quote Link to comment Share on other sites More sharing options...
kubabuk Posted January 12, 2010 Share Posted January 12, 2010 Hi, Not sure if I got it right too . You can always turn each primitive's edge to a separate entity and measure its length. The tricky part would be to associate extracted edges with original points... Quote Link to comment Share on other sites More sharing options...
Macha Posted January 12, 2010 Author Share Posted January 12, 2010 (edited) Hm... It's a bit like this: Say you are in a city and want to know the distance from your home to some shop. The tedious way would be to count every step and multiply it by the step length. But then you have to walk the way before you find out the distance! A pigeon might just take the xy coordinates of both places and calculate the distance, without every having to fly there in the first place. But that doesn't work for a human walking a grid-like street. But as I said before there is actually an easy way to calculate this for a grid. If it isn't a simple grid... well I don't know... something to do with topology and metric spaces... In my wild imagination I was hoping there would be an algorithm that can estimate a metric from the underlying distribution of random points (hahaha) but that may in the end not even be better than just an euclidian distance. Anyway...I think I can get away with an equispaced grid. Just curious. Edited January 12, 2010 by Macha Quote Link to comment Share on other sites More sharing options...
edward Posted January 13, 2010 Share Posted January 13, 2010 http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm ? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.