Cross Track Error

Hi All, I was wondering how does AOG calculate cross track error or the distance from the AB line? Does it use Euclidean distance from the current xy position of the UTM grid? Also how does it maintain the correct sign of this error i.e. left or right of the line?