Click here to Skip to main content
15,893,814 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Best Fit Algo. Pin
cp98768-Jun-08 11:45
cp98768-Jun-08 11:45 
AnswerRe: Best Fit Algo. Pin
Mark Churchill9-Jun-08 18:44
Mark Churchill9-Jun-08 18:44 
AnswerRe: Best Fit Algo. Pin
Tadeusz Westawic12-Jun-08 18:41
Tadeusz Westawic12-Jun-08 18:41 
QuestionCollision Detection Pin
AliN13626-Jun-08 5:36
AliN13626-Jun-08 5:36 
AnswerRe: Collision Detection [modified] PinPopular
73Zeppelin6-Jun-08 6:47
73Zeppelin6-Jun-08 6:47 
AnswerRe: Collision Detection Pin
Arash Partow6-Jun-08 10:59
Arash Partow6-Jun-08 10:59 
AnswerRe: Collision Detection Pin
Mark Churchill9-Jun-08 18:43
Mark Churchill9-Jun-08 18:43 
AnswerRe: Collision Detection Pin
Tadeusz Westawic12-Jun-08 20:00
Tadeusz Westawic12-Jun-08 20:00 
Non-Numerics R Us, use bitmaps and the GDI Bitblt() function.

Two congruent bitmaps A and B each contain some 'on' bits and some 'off' bits and we wish to determine if any 'on' bits occupy the same coord location in both maps.

1. A AND B yields a bitmap with 'on' bits only where the 'on' bits of A and B collided.

2. Row-wise OR the first half of C with its second half, then the first one fourth with the second one forth, etc. until all rows are ORed to a single row.

3. Repeat step 2, except column-wise for the first row only until ORed to a single bit.

If the upper-left bit is 'on', then a collision occurred.

This method always answers yes or no, but never how many or where. You might ask what use is that?

I have used blitter and bitmaps in (unsuccessful) attempt to simulate fluid flow through a maze by pumping bits into the entrance and sumping them out the exit. My bits just wouldn't flow and I need a better notion of 'boolean soup'.

I have also used this method to successfully determine if constrained random walks in integer 3-space cross one another.

This method boasts a strictly linear increase in execution time as number of objects to test increases. This feature makes it useful for very large numbers of objects like the hundreds of thousands of bits bouncing around in my mazes, keeping track of which are moving N, E, S, W and colliding with each other or with maze walls.

Tadeusz Westawic

An ounce of Clever is worth a pound of Experience.

GeneralRe: Collision Detection Pin
Tadeusz Westawic13-Jun-08 3:35
Tadeusz Westawic13-Jun-08 3:35 
QuestionMultidimensional Logic? Pin
Leslie Sanford5-Jun-08 7:23
Leslie Sanford5-Jun-08 7:23 
AnswerRe: Multidimensional Logic? Pin
PIEBALDconsult5-Jun-08 8:12
mvePIEBALDconsult5-Jun-08 8:12 
QuestionMercator distance Pin
michela4-Jun-08 22:12
michela4-Jun-08 22:12 
AnswerRe: Mercator distance Pin
Arash Partow5-Jun-08 1:41
Arash Partow5-Jun-08 1:41 
AnswerRe: Mercator distance Pin
73Zeppelin5-Jun-08 4:54
73Zeppelin5-Jun-08 4:54 
GeneralRe: Mercator distance Pin
MarkB7775-Jun-08 22:05
MarkB7775-Jun-08 22:05 
GeneralRe: Mercator distance Pin
michela6-Jun-08 0:59
michela6-Jun-08 0:59 
GeneralRe: Mercator distance [modified] Pin
73Zeppelin6-Jun-08 2:22
73Zeppelin6-Jun-08 2:22 
GeneralRe: Mercator distance Pin
michela6-Jun-08 2:56
michela6-Jun-08 2:56 
GeneralRe: Mercator distance Pin
73Zeppelin6-Jun-08 3:27
73Zeppelin6-Jun-08 3:27 
QuestionWorth its Salt? Pin
Brady Kelly3-Jun-08 4:48
Brady Kelly3-Jun-08 4:48 
AnswerRe: Worth its Salt? Pin
Arash Partow3-Jun-08 8:21
Arash Partow3-Jun-08 8:21 
GeneralRe: Worth its Salt? Pin
Brady Kelly3-Jun-08 22:34
Brady Kelly3-Jun-08 22:34 
QuestionAuto Update Algorithm Pin
Richard Andrew x6431-May-08 14:19
professionalRichard Andrew x6431-May-08 14:19 
AnswerRe: Auto Update Algorithm Pin
Nelek1-Jun-08 5:37
protectorNelek1-Jun-08 5:37 
QuestionSimple shape recognition Pin
Jim Crafton30-May-08 9:20
Jim Crafton30-May-08 9:20 

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.