if y > 0 then if x > 0 then tc1 = arctan(y/x) if x < 0 then tc1 = 180 - arctan(-y/x) if x = 0 then tc1 = 90 if y < 0 then if x > 0 then tc1 = -arctan(-y/x) if x < 0 then tc1 = arctan(y/x)-180 if x = 0 then tc1 = 270 if y = 0 then if x > 0 then tc1 = 0 if x < 0 then tc1 = 180 if x = 0 then [the 2 points are the same]