If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
(otherwise you must use absolute values)
what I propose is the following method:
x1-x will give you the X distance between the points,
y1-y will give you the Y between the points.
now i build a right angle triangle
where one angle is 90 degrees.
and two lengths are known
to get the angles:
(x1-x)/(y1-y)=(a)/(90-a)
so just compute (x1-x)*(y1-y) into z
and you angle is either 90*z/z+1
or 90 minus that.
try to draw it out, and it'll be clearer.