~/**************************************************************************** ~/ ANGLEIJK.MAC (1.1): expression to calculate the turning angle of a turn ~/ ~/ The result of this expression is the turning angle in degrees, ranging ~/ from -180 to +180. A zero angle corresponds to a straight through turn, ~/ negative values imply left turns and positive values imply right turns. ~/ ~/ Note that the expression will cause division by zero for u-turns. But ~/ these are benign and still lead to the numerically correct result -180. ~/ ~/ 94-09-28 Heinz Spiess, EMME/2 Support Center, CH-2558 Aegerten, Switzerland ~/**************************************************************************** 180.*atan(put((xk-xj)*(yj-yi)-(yk-yj)*(xj-xi))/ put((xk-xj)*(xj-xi)+(yk-yj)*(yj-yi)))/3.1415926 +360*((get(1)>0)-.5)*(get(2)<0)