Academy
Formulas/maths/3d Geometry/Section Formula

Section Formula

Point dividing PQ internally in ratio m:n. For external division, replace n with −n. Midpoint is the special case m = n = 1.
Derivation

Let P(x1,y1,z1)P(x_1, y_1, z_1) and Q(x2,y2,z2)Q(x_2, y_2, z_2). Let RR divide PQPQ internally in ratio m:nm:n, so PR:RQ=m:nPR:RQ = m:n.

x-coordinate: Project onto the x-axis. Lengths PRPR and RQRQ project to xRx1x_R-x_1 and x2xRx_2-x_R. Since PR:RQ=m:nPR:RQ = m:n:

xRx1x2xR=mn    n(xRx1)=m(x2xR)\frac{x_R-x_1}{x_2-x_R} = \frac{m}{n} \implies n(x_R-x_1) = m(x_2-x_R) xR(m+n)=mx2+nx1    xR=mx2+nx1m+nx_R(m+n) = mx_2+nx_1 \implies x_R = \frac{mx_2+nx_1}{m+n}

Similarly for yy and zz.

R=(mx2+nx1m+n,  my2+ny1m+n,  mz2+nz1m+n)R = \left(\frac{mx_2+nx_1}{m+n},\;\frac{my_2+ny_1}{m+n},\;\frac{mz_2+nz_1}{m+n}\right)

External division (ratio m:nm:n externally): Replace nn with n-n:

R=(mx2nx1mn,  my2ny1mn,  mz2nz1mn)R = \left(\frac{mx_2-nx_1}{m-n},\;\frac{my_2-ny_1}{m-n},\;\frac{mz_2-nz_1}{m-n}\right)

Midpoint (m=n=1m = n = 1):

M=(x1+x22,  y1+y22,  z1+z22)M = \left(\frac{x_1+x_2}{2},\;\frac{y_1+y_2}{2},\;\frac{z_1+z_2}{2}\right)

Centroid of triangle with vertices AA, BB, CC:

G=(x1+x2+x33,  y1+y2+y33,  z1+z2+z33)G = \left(\frac{x_1+x_2+x_3}{3},\;\frac{y_1+y_2+y_3}{3},\;\frac{z_1+z_2+z_3}{3}\right)