Click here to Skip to main content
15,921,454 members
Home / Discussions / C#
   

C#

 
QuestionRe: Server/Client App. Pin
jojoba201130-Apr-12 17:25
jojoba201130-Apr-12 17:25 
QuestionHow to stop downloading progress in WebClient? Pin
amx_tiger29-Apr-12 20:27
amx_tiger29-Apr-12 20:27 
AnswerRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen30-Apr-12 4:55
professionalEddy Vluggen30-Apr-12 4:55 
GeneralRe: How to stop downloading progress in WebClient? Pin
amx_tiger30-Apr-12 5:15
amx_tiger30-Apr-12 5:15 
AnswerRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen30-Apr-12 5:33
professionalEddy Vluggen30-Apr-12 5:33 
GeneralRe: How to stop downloading progress in WebClient? Pin
amx_tiger30-Apr-12 5:43
amx_tiger30-Apr-12 5:43 
AnswerRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen30-Apr-12 5:55
professionalEddy Vluggen30-Apr-12 5:55 
GeneralRe: How to stop downloading progress in WebClient? Pin
amx_tiger30-Apr-12 6:09
amx_tiger30-Apr-12 6:09 
QuestionRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen30-Apr-12 6:16
professionalEddy Vluggen30-Apr-12 6:16 
AnswerRe: How to stop downloading progress in WebClient? Pin
amx_tiger30-Apr-12 6:35
amx_tiger30-Apr-12 6:35 
GeneralRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen30-Apr-12 7:02
professionalEddy Vluggen30-Apr-12 7:02 
GeneralRe: How to stop downloading progress in WebClient? Pin
amx_tiger30-Apr-12 22:19
amx_tiger30-Apr-12 22:19 
GeneralRe: How to stop downloading progress in WebClient? Pin
Eddy Vluggen1-May-12 1:02
professionalEddy Vluggen1-May-12 1:02 
QuestionInserting a row into an Access Database with C# Pin
Premisoft29-Apr-12 20:00
Premisoft29-Apr-12 20:00 
AnswerRe: Inserting a row into an Access Database with C# Pin
OriginalGriff29-Apr-12 22:05
mveOriginalGriff29-Apr-12 22:05 
GeneralRe: Inserting a row into an Access Database with C# Pin
Premisoft30-Apr-12 3:48
Premisoft30-Apr-12 3:48 
GeneralRe: Inserting a row into an Access Database with C# Pin
Wes Aday30-Apr-12 5:23
professionalWes Aday30-Apr-12 5:23 
QuestionWinmm.dll for CF Windows CE Pin
baranils29-Apr-12 11:30
baranils29-Apr-12 11:30 
QuestionCollision detection between a circle and rectangle Pin
lethula29-Apr-12 5:46
lethula29-Apr-12 5:46 
AnswerRe: Collision detection between a circle and rectangle Pin
Abhinav S29-Apr-12 16:36
Abhinav S29-Apr-12 16:36 
GeneralRe: Collision detection between a circle and rectangle Pin
lethula30-Apr-12 13:20
lethula30-Apr-12 13:20 
AnswerRe: Collision detection between a circle and rectangle Pin
BobJanova29-Apr-12 23:18
BobJanova29-Apr-12 23:18 
GeneralRe: Collision detection between a circle and rectangle Pin
lethula30-Apr-12 13:27
lethula30-Apr-12 13:27 
GeneralRe: Collision detection between a circle and rectangle Pin
BobJanova30-Apr-12 22:19
BobJanova30-Apr-12 22:19 
It isn't really a C# question, the algorithm looks the same in any C family language. It also depends how you've defined your rectangle (a circle will be centre and radius I assume). But essentially it goes like:
1. find the coordinate shift needed to place the rectangle with its centre at (0,0) and its sides along the X and Y axes
2. apply this same shift to the centre point of the circle

Now you can check whether the centre of the circle is inside the possible collision region which is a rectangle of half-size [hw + r, hh + r] centred on the origin (hw and hh being the half-width and height of the initial rectangle). If it's inside this box, if it's in one of the four corner nibbles you check the distance from the relevant corner point (collision if r² > |circle centre - corner|²), otherwise there is a collision.
GeneralRe: Collision detection between a circle and rectangle Pin
lethula1-May-12 22:17
lethula1-May-12 22:17 

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.