Some programming etics: store return values instead of calling same function with same parameters.

I have no idea why you would need to calculate the angleoffset, it's suppose to be constant, you could use a fixed arrowheadline length also, but you have the same length as the arrow base itself, is this nessesary?

i spotted the error though, x and y are not absolute but relative to the arrowhead, add the arrowhead coordinate to get the absolute coordinate