The distance between any two points P(x₁, y₁) and Q(x₂, y₂) is determined using the Pythagorean theorem:
PQ = √[(x₂ - x₁)² + (y₂ - y₁)²]
The coordinates of a point P(x, y) which divides the line segment joining A(x₁, y₁) and B(x₂, y₂) internally in the ratio m₁ : m₂ are given by:
P(x, y) = ( (m₁x₂ + m₂x₁) / (m₁ + m₂), (m₁y₂ + m₂y₁) / (m₁ + m₂) )