A(dot)B = mod(A) x mod(B) x cos(angle)

Where:

A = ax+by = (a, b)

B = mx+ny = (m, n)

And so:

A(dot)B = am + bn

mod(A) = sqrt(a^2 + b^2)

mod(B) = sqrt(m^2 + n^2)

Therefore:

angle = cos<sup>-1</sup>((am + bn) / (sqrt(a^2 + b^2) * sqrt(m^2 + n^2))

And you can work out your vectors from (restarting the notation usage!):

a: (m, n)

b: (o, p)

c: (q, r)

A = ba = (m - o, n - p)

B = bc = (q - o, r - p)

Sorry for the horrendous notation: its impossible to write vector math on the web!

Andy