something like this (mix of real and psuedocode)

// assume here that your line endpoints are know

// as x1,y1 x2,y2, and that you want the arrow at x1,y1 end

// and that int arrowsize represents how far back the arrow

// starts on the line. note that you'll want to add checks to

// make sure that the arrowhead isn't longer than the line.

// and also note that you should scale the arrow size with the

// line thickness.

// this is the angle of the line (origin at x1,y1)

double theta = atan2(x2-x1,y2-y1); // see the ref on atan2

// now find the vertical and horizontal components of

// a point located arrowsize away from x1,y1

int x3 = x1 + (arrowsize * cos(theta));

int y3 = y1 + (arrowsize * sin(theta));

// now you need to find the other points of the arrowhead:

// /A

// /

// E--M----------------------

// \

// \B

// we just got M, now we need A and B, where the fatness is

// represented by some scale of arrowsize we'll assume fatness

// is already declared, a good value might be .33

// the other points are as follows

int x4 = x3 + ((y3 - y1) * fatness);

int y4 = y3 + ((x3 - x1) * fatness);

// and

int x5 = x3 - ((y3 - y1) * fatness);

int y5 = y3 - ((x3 - x1) * fatness);

// from there, just draw away.