# Section formula

In coordinate geometry, the Section formula is a formula used to find the ratio in which a line segment is divided by a point internally or externally. It is used to find out the centroid, incenter and excenters of a triangle. In physics, it is used to find the center of mass of systems, equilibrium points, etc.

## Internal Divisions

If point P (lying on AB) divides the line segment AB joining the points $\mathrm {A} (x_{1},y_{1})$ and $\mathrm {B} (x_{2},y_{2})$ in the ratio m:n, then
$P=\left({\frac {mx_{2}+nx_{1}}{m+n}},{\frac {my_{2}+ny_{1}}{m+n}}\right)$
The ratio m:n can also be written as $m/n:1$, or $k:1$, where $k=m/n$. So, the coordinates of point $P$ dividing the line segment joining the points $\mathrm {A} (x_{1},y_{1})$ and $\mathrm {B} (x_{2},y_{2})$ are:
$\left({\frac {mx_{2}+nx_{1}}{m+n}},{\frac {my_{2}+ny_{1}}{m+n}}\right)$
$=\left({\frac {{\frac {m}{n}}x_{2}+x_{1}}{{\frac {m}{n}}+1}},{\frac {{\frac {m}{n}}y_{2}+y_{1}}{{\frac {m}{n}}+1}}\right)$
$=\left({\frac {kx_{2}+x_{1}}{k+1}},{\frac {ky_{2}+y_{1}}{k+1}}\right)$
Similarly, the ratio can also be written as $k:(1-k)$, and the coordinates of P are $((1-k)x_{1}+kx_{2},(1-k)y_{1}+ky_{2})$.

### Proof

Triangles $PAQ\sim BPC$.
    ${\begin{aligned}{\frac {AP}{BP}}={\frac {AQ}{CP}}={\frac {PQ}{BC}}\\{\frac {m}{n}}={\frac {x-x_{1}}{x_{2}-x}}={\frac {y-y_{1}}{y_{2}-y}}\\mx_{2}-mx=nx-nx_{1},my_{2}-my=ny-ny_{1}\\mx+nx=mx_{2}+nx_{1},my+ny=my_{2}+ny_{1}\\(m+n)x=mx_{2}+nx_{1},(m+n)y=my_{2}+ny_{1}\\x={\frac {mx_{2}+nx_{1}}{m+n}},y={\frac {my_{2}+ny_{1}}{m+n}}\\\end{aligned}}$

## External Divisions

If a point P (lying on the extension of AB) divides AB in the ratio m:n then
$P=\left({\dfrac {mx_{2}-nx_{1}}{m-n}},{\dfrac {my_{2}-ny_{1}}{m-n}}\right)$

### Proof

Triangles $PAC\sim PBD$ (Let C and D be two points where A & P and B & P intersect respectively). Therefore ∠ACP = ∠BDP
    ${\begin{aligned}{\frac {AB}{BP}}={\frac {AC}{BD}}={\frac {PC}{PD}}\\{\frac {m}{n}}={\frac {x-x_{1}}{x-x_{2}}}={\frac {y-y_{1}}{y-y_{2}}}\\mx-mx_{2}=nx-nx_{1},my-my_{2}=ny-ny_{1}\\mx-nx=mx_{2}-nx_{1},my-ny=my_{2}-ny_{1}\\(m-n)x=mx_{2}-nx_{1},(m-n)y=my_{2}-ny_{1}\\x={\frac {mx_{2}-nx_{1}}{m-n}},y={\frac {my_{2}-ny_{1}}{m-n}}\\\end{aligned}}$

## Midpoint formula

The midpoint of a line segment divides it internally in the ratio 1:1{\textstyle 1:1}. Applying the Section formula for internal division:
$P=\left({\dfrac {x_{1}+x_{2}}{2}},{\dfrac {y_{1}+y_{2}}{2}}\right)$

### Derivation

$P=\left({\dfrac {mx_{2}+nx_{1}}{m+n}},{\dfrac {my_{2}+ny_{1}}{m+n}}\right)$
$=\left({\frac {1\cdot x_{1}+1\cdot x_{2}}{1+1}},{\frac {1\cdot y_{1}+1\cdot y_{2}}{1+1}}\right)$
$=\left({\dfrac {x_{1}+x_{2}}{2}},{\dfrac {y_{1}+y_{2}}{2}}\right)$

## Centroid

The centroid of a triangle is the intersection of the medians and divides each median in the ratio 2:1{\textstyle 2:1}. Let the vertices of the triangle be $A(x_{1},y_{1})$, B(x$_2$, y$_2$){\textstyle B(x_{2}, y_{2})} and C(x$_3$, y$_3$){\textstyle C(x_{3}, y_{3})}. So, a median from point A will intersect BC at ( (x$_2$+x$_3$)/2, (y$_2$+y$_3$)/2 ){\textstyle \left({\frac {x_{2}+x_{3}}{2}}, {\frac {y_{2}+y_{3}}{2}}\right)}. Using the section formula, the centroid becomes:
    $\left({\frac {x_{1}+x_{2}+x_{3}}{3}},{\frac {y_{1}+y_{2}+y_{3}}{3}}\right)$

## In 3-Dimensions

Let A and B be two points with Cartesian coordinates (x$_1$, y$_1$, z$_1$) and (x$_2$, y$_2$, z$_2$) and P be a point on the line through A and B. If $AP:PB=m:n$. Then the section formula gives the coordinates of P as
$\left({\frac {mx_{2}+nx_{1}}{m+n}},{\frac {my_{2}+ny_{1}}{m+n}},{\frac {mz_{2}+nz_{1}}{m+n}}\right)$
If, instead, P is a point on the line such that $AP:PB=k:1-k$, its coordinates are $((1-k)x_{1}+kx_{2},(1-k)y_{1}+ky_{2},(1-k)z_{1}+kz_{2})$.

## In vectors

The position vector of a point P dividing the line segment joining the points A and B whose position vectors are ${\vec {a}}$ and ${\vec {b}}$
* in the ratio $m:n$ internally, is given by ${\frac {n{\vec {a}}+m{\vec {b}}}{m+n}}$
* in the ratio $m:n$ externally, is given by ${\frac {m{\vec {b}}-n{\vec {a}}}{m-n}}$