4
$\begingroup$

My question is following. I have a line with a given $(X_1, Y_1)$ and $(X_2, Y_2)$ coordinates (see figure below). I need to calculate coordinates of the middle of this line $(X, Y)$. I tried to use classical method of finding distance between two coordinates, but it works only when the line is situated horizontally.

Could anybody help me with a formula to find coordinates of the middle of a given line please?

Thanks beforehand.

Line

  • 0
    Generalization: You can get any point along the line by doing a weighted average of the vectors (e.g. $0.1*p1 + 0.9*p2$, to get 90% of the way towards p2).2011-06-08

2 Answers 2

12

You can just average the points: $x = \dfrac{x_1 + x_2}{2}$ $y = \dfrac{y_1 + y_2}{2}$

4

The midpoint formula

  • 0
    Mr Anderson: Didn't I hear you say, "I'd have to comment..." a while ago? On the other hand: what is a tongue good for if you're unable to spea..k? Yes, I know you're Mr Smith, but I prefer to call you Anderson.2011-06-07
  • 0
    @Theo: HAH! My (gr)avatar came about after a not-so-subtle rivalry popped up between me and another moderator ("johnny" - after *johnny mnemonic*) on mymathforum.com - but apparently Mr. Smith doesn't prevail in the end /:2011-06-07
  • 1
    :) That "tongue" should have been a "phone call"... sorry about that.2011-06-07