coord-transf. 2d elements 3d elements non geo scripts functions control statem. attributes various addons arithmetics circle mathematics statistics string array binary special ACS ASN ATN COS SIN TAN PI
 Name ATN SyntaxATN(expression) expression, Type real Returns the angle in the right angled triangle, which opposite to the adjacent are in proportion expression:1. This funcion is inverse to the tangent function TAN. s = y/x   ! = gradient angle = ATN(s) Tips and Tricks The arc tangent offers not for all quadrants the correct angle related to the X-axis directly. One as to differ by the gradient (x/y) in the following cases: IF x=0 AND y=0 THEN   angle=0   ELSE   IF x THEN angle=ATN(y/x) ELSE angle=90+180*(y<0)   IF angle<0 AND x<0 and y>0 THEN angle=180+angle   IF angle>0 AND x<0 and y<0 THEN angle=180+angle   IF angle<0 AND x>0 and y<0 THEN angle=angle+360   IF angle>=360 THEN angle=angle-360   ENDIF The same functionality in a compact code: IF x THEN   angle=360*FRA((360+ATN(y/x)+(x<0)*180)/360)   ELSE   angle=90+180*(y<0)   ENDIF Wikipedia: Einheitskreis Winkelfunktionen Arcus-Tangens Arcus-Cotangens Wolfram Research-Mathworld: Trigonometric functions GDL-Handbuch 4.5 (DE) p. 95 GDL-Handbuch 5.0 (DE) p. 126 GDL-Handbuch 6.0 (DE) p. 175 GDL-Handbuch 6.5 (DE) p. 177 GDL-Handbuch 7.0 (DE) p. 177 GDL-Handbuch 8.0 (DE) p. 120 GDL-Handbuch 8.1 (DE) p. 121 GDL-Handbuch 9.0 (DE) p. 200 GDL-Handbuch 10.0 (DE) p. 202 GDL-Handbuch 11.0 (DE) p. 208 GDL Reference Guide 9.0 (INT) p. 194 GDL Reference Guide 10.0 (INT) p. 200 GDL Reference Guide 11.0 (INT) p. 200 Abb. 1: Gradient at the unit circle 