(* This module shows one aspect of the solver's qualitative performance. Given three initial points, it shows the solution produced by the solver when those points are constrained to lie at the vertices of an equalateral triangle. *) CONST CrossWidth = 2, CrossColor = Color.Red, PreWidth = 1.5, PreColor = CrossColor, PostWidth = 2, PostColor = Color.Grey50; PROC Cross(a) IS IF VAR b ~ R2.Plus(a, (-5.309, 0)), c ~ R2.Plus(a, (5.309, 0)), d ~ R2.Plus(a, (0, 5.309)), e ~ R2.Plus(a, (0, -5.309)) IN a = Geometry.Mid(b, c) AND a = Geometry.Mid(d, e) AND e VER d AND b HOR c AND Geometry.CongXY(b, c, d, e) -> PS.MoveTo(d); PS.LineTo(e); PS.MoveTo(b); PS.LineTo(c); PS.Stroke() END FI END; UI PointTool(Cross); PROC StrokeTri(a, b, c) IS Triangle.Draw(a, b, c); PS.Stroke() END; UI PointTool(StrokeTri); PROC DrawCrosses(a, b, c) IS SAVE PS IN PS.SetColor(PreColor); PS.SetWidth(PreWidth); StrokeTri(a, b, c) END; SAVE PS IN PS.SetColor(CrossColor); PS.SetWidth(CrossWidth); Cross(a); Cross(b); Cross(c) END END; UI PointTool(DrawCrosses); PROC TrTest(a, b, c) IS IF VAR a1 ~ a, b1 ~ b, c1 ~ c IN (a1, b1) CONG (b1, c1) AND (a1, b1) CONG (a1, c1) -> SAVE PS IN PS.SetColor(PostColor); PS.SetWidth(PostWidth); StrokeTri(a1, b1, c1) END END FI; DrawCrosses(a, b, c) END; UI PointTool(TrTest); PROC Cmd0() IS VAR a ~ (-59.08, 116), b ~ (-36.35, -78.88), c ~ (70.44, 86.47) IN TrTest(a, b, c) END END;