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

Algorithms

 
Questionlinear algebra library Pin
ovoundaga8-Jul-07 2:03
ovoundaga8-Jul-07 2:03 
AnswerRe: linear algebra library Pin
Stephen Hewitt8-Jul-07 15:03
Stephen Hewitt8-Jul-07 15:03 
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 
Hi,

this sounds reasonable, provided:
1) there are many CHAR1 (otherwise it all does not matter)
2) the greatest possible radius of a circle is small with respect to MAP size

I am not sure about your integer division stuff; the line y = mx + b seems to
imply floating-point: m and b wont be integers.
BTW: the general equation for a line is a*x + b*y + c = 0 which is symmetric in
x and y, resulting in no trouble when the line is vertical (if you dont like having
3 coefficients, you can divide them all by c provided c is non-zero).

Further thought: there is a useful method Region.IsVisible()
you might apply it to a region that is a (non-orthogonal) rectangle starting at
the shooter, pointing in the direction he is shooting, and having a width of
twice "the greatest possible radius of a circle" and a length sufficient to
cross the border of MAP.
Using it you would mean you do not need your squares after all, simply test each
circle's center against it (very simple, probably fast too).
As a side effect you could shoot circles that are off-screen too (by making the
rectangle length quite large) !

Smile | :)


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

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.