View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.charting
Xt Xt is offline
external usenet poster
 
Posts: 49
Default calculate a point

On Jul 2, 4:30*am, Curbie wrote:
I'm trying to calculate some steps or stages for a graph and am having
trouble, basically I'm trying to calculate a line between a point x,y
to a point on a line between x1,y1 and x2,y2 that looks some like
this:

* * * * * .x2,y2(8,6)
* * * * */
* * * * /-----------------------------------x,y(13,3)
* * * /
* * *.x1,y1(1,1)

I think I got the slope 5/7=0.7142857, but I'm looking for the
equation to calculate line between a point x,y to a point on a line
between x1,y1 and x2,y.

Go easy on me, I haven't been to school in 35 years.


Start from slope = (y - y1)/(x - x1) = (y2 - y1)/(x2 - x1). From this
we get the equation you want -

y = y1 + (x - x1)*(y2 - y1)/(x2 - x1). In the above case, the
equation is
y = 1 + (x - 1)*(6 - 1)/(8 - 1) or. if you really need to simplify
this y = 2/7 + 5/7*x

xt