Math formulas and cheat sheets for Lines in two dimensions

Lines in two dimensions

Line forms

Slope y-intercept form:

y=mx+b

Two point form:

yy1=y2y1x2x1(xx1)

Point slope form:

yy1=m(xx1)

Intercept form

xa+yb=1 , (a,b0)

Normal form:

xcosΘ+ysinΘ=p

Parametric form:

xy=x1+tcosα=y1+tsinα

Point direction form:

xx1A=yy1B

where (A,B) is the direction of the line and P1(x1,y1) lies on the line.

General form:

Ax+By+C=0 , (A0 or B0)

Distance

The distance from Ax+By+C=0 to P1(x1,y1) is

d=|Ax1+By1+C|A2+B2

Concurrent lines

Three lines

A1x+B1y+C1A2x+B2y+C2A3x+B3y+C3=0=0=0

are concurrent if and only if:

A1A2A3B1B2B3C1C2C3=0

Line segment

A line segment P1P2 can be represented in parametric form by

xy=x1+(x2x1)t=y1+(y2y1)t0t1

Two line segments P1P2 and P3P4 intersect if any only if the numbers

s=x2x1x3x1y2y1y3y1x2x1x3x4y2y1y3y4  and  t=x3x1x3x4y3y1y3y4x2x1x3x4y2y1y3y4

satisfy 0s1 and 0t1.