(* This module contains a test of the ATAN function in a constraint. When dragging, the constraint is maintained, but when the point "b" is adjusted, it is not. NOTE: A fix to the NonLinearSolve.m3 module on 26-Sept-94 corrected this problem [heydon]. *) CONST Theta = 1; PRED FixedAngle(a, b) IS (E ax, ay, bx, by :: a = (ax, ay) AND b = (bx, by) AND Theta = ATAN(by - ay, bx - ax)) END; FUNC res = Atan(a, b) IS (E ax, ay, bx, by :: a = (ax, ay) AND b = (bx, by) AND res = ATAN(by - ay, bx - ax)) END; PROC Cmd0() IS IF VAR a = (27.27, 28.82), b ~ (74.98, 103.1) IN FixedAngle(a, b) -> PS.MoveTo(a); PS.LineTo(b); PS.Type(b, Unparse.Value(Atan(a, b))) END FI END;