(* This figure demonstrates Morley's theorem, announced in 1899 by American mathematician Frank Morley (1860-1937). Morley proved that if the three interior angles of any triangle are trisected, the three intersection points always form an equilateral triangle. In this figure, the red lines are the lines of trisection, and the equilateral triangle formed from their points of intersection is shown in blue. *) PRED Trisect(a, b, c, e, f) IS (E g ~ (1.529, 0) REL (b, c) :: Geometry.Colinear(b, c, g) AND (a, b) CONG (b, e) AND (a, b) CONG (b, f) AND (a, b) CONG (b, g) AND (g, f) CONG (f, e) AND (f, e) CONG (e, a)) END; UI PointTool(Trisect); PROC Cmd0() IS IF VAR a = (105.3, -25.03), b = (-173.4, -28.06), c = (-87.86, 163.8), d ~ (84.25, 78.17), e ~ (26.44, 166.2), f ~ (-130.1, 107.4), g ~ (-156.4, 42), h ~ (-90.81, -46.24), i ~ (-7.74, -30.39), j ~ (-62.07, 17.84), k ~ (-89.41, 53.58), l ~ (-44.78, 59.39) IN Trisect(a, b, c, d, e) AND Trisect(b, c, a, h, i) AND Trisect(c, a, b, f, g) AND Geometry.Colinear(b, j, d) AND Geometry.Colinear(a, j, g) AND Geometry.Colinear(b, k, e) AND Geometry.Colinear(c, k, h) AND Geometry.Colinear(c, l, i) AND Geometry.Colinear(a, l, f) -> SAVE PS IN PS.MoveTo(b); PS.LineTo(j); PS.LineTo(a); PS.LineTo(l); PS.LineTo(c); PS.LineTo(k); PS.LineTo(b); PS.SetColor(Color.Red); PS.SetWidth(1); PS.Stroke() END; PS.MoveTo(a); PS.LineTo(b); PS.LineTo(c); PS.Close(); PS.SetWidth(2); PS.Stroke(); SAVE PS IN PS.MoveTo(j); PS.LineTo(k); PS.LineTo(l); PS.Close(); PS.SetColor(Color.Blue); PS.Stroke() END END FI END;