Click here to Skip to main content
15,891,184 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: I think this shouldn't be here... Pin
p_v_chaitanya2-Jul-07 1:51
p_v_chaitanya2-Jul-07 1:51 
AnswerI think this shouldn't be here... Pin
CPallini2-Jul-07 1:47
mveCPallini2-Jul-07 1:47 
QuestionQuick Hit-Testing Pin
Ri Qen-Sin19-Jun-07 3:43
Ri Qen-Sin19-Jun-07 3:43 
AnswerRe: Quick Hit-Testing Pin
Luc Pattyn19-Jun-07 4:30
sitebuilderLuc Pattyn19-Jun-07 4:30 
GeneralRe: Quick Hit-Testing Pin
Ri Qen-Sin19-Jun-07 6:09
Ri Qen-Sin19-Jun-07 6:09 
GeneralRe: Quick Hit-Testing Pin
Luc Pattyn19-Jun-07 6:53
sitebuilderLuc Pattyn19-Jun-07 6:53 
GeneralRe: Quick Hit-Testing Pin
Ri Qen-Sin19-Jun-07 13:30
Ri Qen-Sin19-Jun-07 13:30 
GeneralRe: Quick Hit-Testing Pin
cp987619-Jun-07 18:39
cp987619-Jun-07 18:39 
Just to ensure that you know that testing for intersection with circles is reasonably inexpensive:

if floating point, normalise equation of line
ax + by + c = 0
so that a^2+b^2=1
then the test for intersection with circle centre (x0,y0) radius r0 is
abs(a*x0 + b*y0 + c) <= r0

If integers, then there are several ways, but
(a*x0 + b*y0 +c)^2 < (a^2+b^2)*r0^2
is reasonably cheap (4 multiplications and 2 additions) assuming that r0^2 and (a^2+b^2) is precomputed. You may have to be careful about overflows.

With modern GFLOP processors, you can test a lot of circles in real time. It all depends on how many circles you have and how they are organised.



Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

GeneralRe: Quick Hit-Testing Pin
Luc Pattyn20-Jun-07 1:45
sitebuilderLuc Pattyn20-Jun-07 1:45 
GeneralRe: Quick Hit-Testing Pin
Ri Qen-Sin20-Jun-07 2:59
Ri Qen-Sin20-Jun-07 2:59 
GeneralRe: Quick Hit-Testing Pin
Luc Pattyn20-Jun-07 3:56
sitebuilderLuc Pattyn20-Jun-07 3:56 
GeneralRe: Quick Hit-Testing Pin
Ri Qen-Sin20-Jun-07 14:25
Ri Qen-Sin20-Jun-07 14:25 
GeneralRe: Quick Hit-Testing Pin
Ri Qen-Sin20-Jun-07 2:50
Ri Qen-Sin20-Jun-07 2:50 
AnswerRe: Quick Hit-Testing Pin
Stephen Hewitt20-Jun-07 14:13
Stephen Hewitt20-Jun-07 14:13 
GeneralRe: Quick Hit-Testing Pin
cp987620-Jun-07 17:09
cp987620-Jun-07 17:09 
GeneralRe: Quick Hit-Testing Pin
Stephen Hewitt21-Jun-07 16:30
Stephen Hewitt21-Jun-07 16:30 
GeneralRe: Quick Hit-Testing Pin
cp987623-Jun-07 18:34
cp987623-Jun-07 18:34 
AnswerRe: Quick Hit-Testing Pin
Roy Heil2-Jul-07 3:43
professionalRoy Heil2-Jul-07 3:43 
GeneralRe: Quick Hit-Testing: The "Look and See" Method Pin
Luc Pattyn22-Jun-07 7:00
sitebuilderLuc Pattyn22-Jun-07 7:00 
Questionrunge Kutta Pin
Noharyiasa18-Jun-07 23:46
Noharyiasa18-Jun-07 23:46 
AnswerRe: runge Kutta Pin
Luc Pattyn19-Jun-07 0:11
sitebuilderLuc Pattyn19-Jun-07 0:11 
GeneralRe: runge Kutta Pin
Noharyiasa19-Jun-07 0:21
Noharyiasa19-Jun-07 0:21 
GeneralRe: runge Kutta Pin
Luc Pattyn19-Jun-07 1:02
sitebuilderLuc Pattyn19-Jun-07 1:02 
GeneralRe: runge Kutta Pin
Noharyiasa19-Jun-07 1:24
Noharyiasa19-Jun-07 1:24 
GeneralRe: runge Kutta Pin
Jeffrey Walton5-Jul-07 16:39
Jeffrey Walton5-Jul-07 16:39 

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.