Midpoint Formula for any Fraction
Date: 01/26/99 at 00:04:23 From: T.J. Subject: Rectangular coordinate system I need to come up with a formula similar to the midpoint formula. I need this formula to find "any fractional part" of the line from P1 to P2. This is the midpoint formula: X1 + X2 Y1 + Y2 Xm = ------- and Ym = ------- 2 2 The formula I came up with is: X1 + X2 Y1 + Y2 Xa = ------- and Ya = ------- N N where N represents any fraction of the line and Xa is the point on the line. Will this formula actually work? This is where I am stuck. Thanks!
Date: 01/26/99 at 12:05:52 From: Doctor Peterson Subject: Re: Rectangular coordinate system Hi, T.J. Let's start out in one dimension to make it easier. We have two points A and B, and want to find a point C that is F = m/n of the way from one to the other. For instance, F might be 2/3. Here's what we have: 0 A C B +--+---------------------+------+---- |<-------------------------->| | B-A | | |<------------------->| | | F*(B-A) | | The coordinate of point C is A + F*(B-A) = A + F*B - F*A = (1-F)*A + F*B) So the point you are looking for in your two-dimensional problem is Xf = (1-F)*X1 + F*X2 Yf = (1-F)*Y1 + F*Y2 If you have ever used weighted averages, you'll see that that is just what this formula is. The midpoint is a simple average (mean), while your fractional point is the weighted average of the endpoints. - Doctor Peterson, The Math Forum http://mathforum.org/dr.math/
Search the Dr. Math Library:
Ask Dr. MathTM
© 1994-2013 The Math Forum