Alex Rivera | Logout

Greatest linear dimension 2d set of points

Asked 2008-11-26T20:14:32.613
11

Given an ordered set of 2D pixel locations (adjacent or adjacent-diagonal) that form a complete path with no repeats, how do I determine the Greatest Linear Dimension of the polygon whose perimeter is that set of pixels? (where the GLD is the greatest linear distance of any pair of points in the set)

For my purposes, the obvious O(n^2) solution is probably not fast enough for figures of thousands of points. Are there good heuristics or lookup methods that bring the time complexity nearer to O(n) or O(log(n))?

Edit
Report

1 Answer

0

You could maybe draw a circle that was bigger than the polygon and slowly shrink it, checking if youve intersected any points yet. Then your diameter is the number youre looking for. Not sure if this is a good method, it sounds somewhere between O(n) and O(n^2)

answered 2008-11-26T20:21:44.173

Your Answer