If the expected result is 130, it gives -50, if it's 240, it gives 60, if it's 350, it gives -10.
So you can use this way (calculating angles of hits of a scan) :
ASSIGN/ANG_HIT=RAD2DEG(ATAN(SCN1.HIT[1..SCN1.NUMHITS].Y/SCN1.HIT[1..SCN1.NUMHITS].X))................................................................................................values between -90 and 90 ASSIGN/COR_HIT1=((SCN1.HIT[1..SCN1.NUMHITS].X-ABS(SCN1.HIT[1..SCN1.NUMHITS].X))/(SCN1.HIT[1..SCN1.NUMHITS].X-ABS(SCN1.HIT[1..SCN1.NUMHITS].X)))...array of 0 and 1 (1 when X<0) ASSIGN/COR_HIT2=((SCN1.HIT[1..SCN1.NUMHITS].Y-ABS(SCN1.HIT[1..SCN1.NUMHITS].Y))/(SCN1.HIT[1..SCN1.NUMHITS].Y-ABS(SCN1.HIT[1..SCN1.NUMHITS].Y)))....array of 0 and 1 (1 when Y<0) ASSIGN/ANG_COR=ANG_HIT+180*(COR_HIT1)+360*(COR_HIT2*(1-COR_HIT1)).................................................................................................................................................values between 0 and 360