[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ProgSoc] join the dots?
On Mon, May 01, 2000 at 12:52:23PM +1000, Tim Johnson wrote:
> Hows this:
> 1. start with array of points (x,y)
> 2. also have an array of lines (x1,y1, x2,y2)
> 3. for each point, create a line to the closest other point, so long as it
> has not already been created, and does not cross over another line.
> 4. do 3. until no more lines are created.
> 5. draw all your lines and you will have optimal triangles.
a simple improvement in the runtime of this algorithm might be to sort
the list of possible lines by size (starting with the smallest
obviously). a good insert sort method (for the lines) might come from
a sort of the points by locality.
"Linux can be a harsh mistress"
-- bert hubert
You are subscribed to the progsoc mailing list. To unsubscribe, send a
message containing "unsubscribe" to firstname.lastname@example.org.
If you are having trouble, ask email@example.com for help.
This list is archived at <http://www.progsoc.uts.edu.au/lists/progsoc/>