Click here to Skip to main content
15,902,842 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Closest Polygon Pin
ProtoBytes19-Feb-10 4:45
ProtoBytes19-Feb-10 4:45 
GeneralRepost Pin
Luc Pattyn19-Feb-10 4:58
sitebuilderLuc Pattyn19-Feb-10 4:58 
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 
The problem with circle approach is that you need to calculate the radius to every point to determine if it is within the circle, determining the radius of the next circle and iterating through it again.
This is worse than determining the distance to each point once and taking the one with the smallest radial distance.
If you need to do this in real time, you want to take an approach where you break the world up into 2 kinds of polygons, 'rooms', which are obvious, or 'not rooms', where the border between 'not room' polygons is the line equidistant between 2 rooms.
This way, every polygon is a room, or the area closest to a particular room.
If you know what polygon you are in, you either know the room you are in, or the room you are closest to.
You use the same code to determine which polygon you are in, either way.
The only special code is breaking up the world ahead of time.

Richard
Opacity, the new Transparency.

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 
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 

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.