Position between two points?

I have a python application where I need to find a position that is exactly in the middle between the two screen coordinates, but I cannot find an algorithm for this. How can I do that?

+5
source share
4 answers

X-coordinate (x1 + x2) / 2

y coordinate (y1 + y2) / 2

+16
source

This is elementary geometry:

  • point1 (x1, y1)
  • point2 (x2, y2)
  • point_in_the_middle (x = (x1 + x2) / 2, y = (y1 + y2) / 2)

Or did you mean something else?

dmckee: Yes dear! :)

+5
source
+3

(C) (A, B):

Cx = (Ax + Bx) / 2
Cy = (Ay + By) / 2
+1

All Articles