|
-
Apr 12th, 2009, 09:21 AM
#1
Thread Starter
Member
-
Apr 12th, 2009, 02:34 PM
#2
Re: Finding a point on a line
The slope of a line can be found given any two points on the line. To calculate the slope, divide the difference in the Y-values by the difference in X-values.
Slope = (Y2 - Y1)/(X2 - X1)
Slope = (Y3 - Y1)/(X3 - X1)
This obviously implies that (Y3 - Y1)/(X3 - X1) = (Y2 - Y1)/(X2 - X1)
Solving for Y3, you get: Y3 = Y1 + (X3 - X1)(Y2 - Y1)/(X2 - X1)
-
Apr 12th, 2009, 05:54 PM
#3
Re: Finding a point on a line
Just as an edge case, you might have a vertical line in which case the above formula will throw a division by zero, since the question isn't well defined. Of course it depends on the problem, just wanted to bring it up in case it would cause a bug later.
The time you enjoy wasting is not wasted time.
Bertrand Russell
<- Remember to rate posts you find helpful.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|