Understanding the Atan2, Please help

you need to swap from atan2(y1-y2,x1-x2) to atan2(y2-y1,x2-x1)