Click here to Skip to main content
15,893,266 members
Home / Discussions / C#
   

C#

 
AnswerRe: How do I get an app to run on boot? Pin
cjengler6-Jan-04 5:49
cjengler6-Jan-04 5:49 
AnswerRe: How do I get an app to run on boot? Pin
jparsons6-Jan-04 6:40
jparsons6-Jan-04 6:40 
QuestionPlaying Mp3 file? Pin
thomasa6-Jan-04 3:24
thomasa6-Jan-04 3:24 
AnswerRe: Playing Mp3 file? Pin
Heath Stewart6-Jan-04 4:10
protectorHeath Stewart6-Jan-04 4:10 
GeneralRe: Playing Mp3 file? Pin
thomasa6-Jan-04 4:38
thomasa6-Jan-04 4:38 
Generaldays of week Pin
mnaveed6-Jan-04 1:16
mnaveed6-Jan-04 1:16 
GeneralRe: days of week Pin
Mazdak6-Jan-04 1:39
Mazdak6-Jan-04 1:39 
GeneralRe: days of week Pin
mnaveed6-Jan-04 2:21
mnaveed6-Jan-04 2:21 
GeneralRe: days of week Pin
Mazdak6-Jan-04 2:28
Mazdak6-Jan-04 2:28 
GeneralRe: days of week Pin
Heath Stewart6-Jan-04 2:30
protectorHeath Stewart6-Jan-04 2:30 
GeneralRe: days of week Pin
mnaveed6-Jan-04 3:55
mnaveed6-Jan-04 3:55 
GeneralRe: days of week Pin
Heath Stewart6-Jan-04 5:03
protectorHeath Stewart6-Jan-04 5:03 
GeneralRe: days of week Pin
mnaveed6-Jan-04 5:52
mnaveed6-Jan-04 5:52 
GeneralCreating CSV files Pin
MrEyes6-Jan-04 0:16
MrEyes6-Jan-04 0:16 
GeneralRe: Creating CSV files Pin
Heath Stewart6-Jan-04 4:26
protectorHeath Stewart6-Jan-04 4:26 
Generalreading from DB Pin
hadi20sa5-Jan-04 22:37
hadi20sa5-Jan-04 22:37 
GeneralRe: reading from DB Pin
Mazdak6-Jan-04 0:35
Mazdak6-Jan-04 0:35 
GeneralRe: reading from DB Pin
Anonymous6-Jan-04 23:18
Anonymous6-Jan-04 23:18 
Questiongetting intercept point of lines?? Pin
azusakt5-Jan-04 22:25
azusakt5-Jan-04 22:25 
AnswerRe: getting intercept point of lines?? Pin
Xiangyang Liu 刘向阳5-Jan-04 23:51
Xiangyang Liu 刘向阳5-Jan-04 23:51 
What you need to do is solving linear equations. As you (may) know from college mathematics, the equation of a straight line on a X-Y plane has the following form:

y = kx + b

unless it is a vertical line, in which case the equation has the form

x = b

Here k and b are constants. If you know the equations of the two lines, then the coordinates of the intersecting point (if exists) will be the solution (x, y) of these two equations. So what you need to do is:

a) Find the equation of the two lines.
b) Determine if they have an intersecting point.
c) Find the intersecting point by solving these two equations for x and y.

a) You need to know two different points on each line. Say (x1, y1) and (x2, y2). If x1 = x2, then the line is vertical, the equation is x = x1. Otherwise, the equation is y = kx + b, where k = (y2-y1)/(x2-x1) and b = y1 - x1(y2-y1)/(x2-x1).

b) Suppose you already have the equations of the two lines: y = k1 x + b1 and y = k2 x + b2. If k1 = k2, then the two lines are parallel (there is not intersecting point). If the two lines are both vertical, then there is no intersecting point either. Otherwise the intersecting point exists (but it may not be on the screen, it may be 200 miles away).

c) After a) and b), you can solve the two equations to get the coordinates of the intersecting point. This is left as an exercise. Wink | ;)

Hope you are not bored with the above lecture. Poke tongue | ;-P

P.S. By the way, this is very fast. Even if you have 100 pairs of lines, the code you write will be executed instantly.





My articles and software tools





Questionhow to change dos prompt caption! Pin
yu-yu5-Jan-04 21:12
yu-yu5-Jan-04 21:12 
AnswerRe: how to change dos prompt caption! Pin
Philip Fitzsimons6-Jan-04 2:54
Philip Fitzsimons6-Jan-04 2:54 
AnswerRe: how to change dos prompt caption! Pin
Heath Stewart6-Jan-04 3:16
protectorHeath Stewart6-Jan-04 3:16 
GeneralRe: how to change dos prompt caption! Pin
Xiangyang Liu 刘向阳6-Jan-04 3:43
Xiangyang Liu 刘向阳6-Jan-04 3:43 
Questionmoving all an app's menus into menus.cs? Pin
TuringTest15-Jan-04 19:56
TuringTest15-Jan-04 19:56 

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.