Click here to Skip to main content
15,913,941 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Closest Polygon Pin
Richard Andrew x6419-Feb-10 6:12
professionalRichard Andrew x6419-Feb-10 6:12 
AnswerRe: Closest Polygon [modified] Pin
harold aptroot19-Feb-10 6:47
harold aptroot19-Feb-10 6:47 
GeneralRe: Closest Polygon Pin
Richard Andrew x6419-Feb-10 6:55
professionalRichard Andrew x6419-Feb-10 6:55 
GeneralRe: Closest Polygon Pin
harold aptroot19-Feb-10 7:05
harold aptroot19-Feb-10 7:05 
GeneralRe: Closest Polygon Pin
Richard Andrew x6419-Feb-10 7:07
professionalRichard Andrew x6419-Feb-10 7:07 
GeneralRe: Closest Polygon Pin
RichardM121-Feb-10 16:17
RichardM121-Feb-10 16:17 
AnswerRe: Closest Polygon Pin
Member 419459315-Apr-10 14:25
Member 419459315-Apr-10 14:25 
AnswerRe: Closest Polygon Pin
Member 419459315-Apr-10 15:12
Member 419459315-Apr-10 15:12 
Richard,

I hate to double post, but there is a simplification. Sort the points for each polygon manually for lowest Y and lowest X, draw a line between lowest x lowest X and highest y highest Y, then draw a line between the other two points. Calculate the intersection of the lines to form the center point. Put the polygon points and center point into an array as a structure and repeat for all polygons. Sort on the center point Y and X values. Now just look for the closest center to the point. You do not need to divide the building into squares, just look for the closest center to the point. If the list is short enough, don't sort, just scan for the smallest distance between the center and the point (smallest sum of squares).

Dave.
QuestionLinear-time suffix array construction Pin
harold aptroot18-Feb-10 7:43
harold aptroot18-Feb-10 7:43 
AnswerRe: Linear-time suffix array construction Pin
Luc Pattyn18-Feb-10 8:01
sitebuilderLuc Pattyn18-Feb-10 8:01 
GeneralRe: Linear-time suffix array construction Pin
harold aptroot18-Feb-10 8:24
harold aptroot18-Feb-10 8:24 
AnswerRe: Linear-time suffix array construction Pin
Luc Pattyn18-Feb-10 8:43
sitebuilderLuc Pattyn18-Feb-10 8:43 
GeneralRe: Linear-time suffix array construction Pin
harold aptroot18-Feb-10 8:56
harold aptroot18-Feb-10 8:56 
AnswerRe: Linear-time suffix array construction Pin
Luc Pattyn18-Feb-10 8:59
sitebuilderLuc Pattyn18-Feb-10 8:59 
GeneralRe: Linear-time suffix array construction Pin
harold aptroot18-Feb-10 9:10
harold aptroot18-Feb-10 9:10 
AnswerRe: Linear-time suffix array construction Pin
Luc Pattyn18-Feb-10 9:16
sitebuilderLuc Pattyn18-Feb-10 9:16 
GeneralRe: Linear-time suffix array construction Pin
harold aptroot18-Feb-10 9:23
harold aptroot18-Feb-10 9:23 
AnswerRe: Linear-time suffix array construction Pin
Luc Pattyn18-Feb-10 9:47
sitebuilderLuc Pattyn18-Feb-10 9:47 
AnswerRe: Linear-time suffix array construction Pin
Luc Pattyn18-Feb-10 10:07
sitebuilderLuc Pattyn18-Feb-10 10:07 
Questionall pathes with length <bound Pin
Member 268673211-Feb-10 22:29
Member 268673211-Feb-10 22:29 
AnswerRe: all pathes with length <bound Pin
Alan Balkany16-Feb-10 4:09
Alan Balkany16-Feb-10 4:09 
QuestionLooking for address validation algorithm Pin
MichaelChristopher11-Feb-10 5:36
MichaelChristopher11-Feb-10 5:36 
Question2D Self Assemblers - Need an Implementation Guide Pin
Sai Yasodharan2-Feb-10 2:34
Sai Yasodharan2-Feb-10 2:34 
AnswerRe: 2D Self Assemblers - Need an Implementation Guide Pin
Richard MacCutchan2-Feb-10 3:28
mveRichard MacCutchan2-Feb-10 3:28 
JokeRe: 2D Self Assemblers - Need an Implementation Guide Pin
Luc Pattyn2-Feb-10 3:34
sitebuilderLuc Pattyn2-Feb-10 3:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.