(progn
    (setq verythin 0.001)
    (setq thin 0.007)
    (setq med (* thin 1.5))
    (setq thick (* 2 thin))

    (defun ShowTriangle ()
        (setq A (Vertex (Pos 0.45 0.6)))
        (Vertex (Pos 0.42 0.62) (Size 0.03 0.03) (Color "Bg") (Label "A")
          (FontColor "Fg"))
        (setq B (Vertex (Pos 0.6 0.6)))
        (Vertex (Pos 0.62 0.62) (Size 0.03 0.03) (Color "Bg") (Label "B")
          (FontColor "Fg"))
        (setq C (Vertex  (Pos 0.45 0.4)))
        (Vertex (Pos 0.43 0.38) (Size 0.03 0.03) (Color "Bg") (Label "C")
          (FontColor "Fg"))
        (setq AB (Edge (Vertices A B)))
        (setq BC (Edge (Vertices B C)))
        (setq AC (Edge (Vertices A C))))
    (defun ShowBigSquare ()
        (setq D (Vertex  (Pos 0.8 0.45)))
        (setq E (Vertex (Pos 0.65 0.25)))
        (setq BDEC (Polygon (Color "VeryLightBlue") (Vertices B D E C))))
    (defun ShowLittleSquares ()
        (setq F (Vertex (Pos 0.6 0.75)))
        (setq G (Vertex (Pos 0.45 0.75)))
        (setq H (Vertex (Pos 0.25 0.6)))
        (setq K (Vertex (Pos 0.25 0.4)))
        (setq BFGA (Polygon (Color "Pink") (Vertices B F G A)))
        (setq AHKC (Polygon (Color "Pink") (Vertices A H K C))))
    (defun ClearSquares ()
        (set BFGA (Color "Bg")) 
        (set AHKC (Color "Bg"))
        (set BDEC (Color "Bg")))
    (defun ShowLabeledBigSquare ()
        (setq BD (Edge (Vertices B D)))
        (setq DE (Edge (Vertices D E)))
        (setq EC (Edge (Vertices E C)))
        (Vertex (Pos 0.82 0.45) (Size 0.03 0.03) (Color "Bg") (Label "D")
          (FontColor "Fg"))
        (Vertex (Pos 0.67 0.23) (Size 0.03 0.03) (Color "Bg") (Label "E")
          (FontColor "Fg"))
        (set BDEC (Color "VeryLightBlue")))
    (defun ShowLabeledLittleSquares ()
        (setq BF (Edge (Vertices B F)))
        (setq FG (Edge (Vertices F G)))
        (setq GA (Edge (Vertices G A)))
        (setq AH (Edge (Vertices A H)))
        (setq HK (Edge (Vertices H K)))
        (setq KC (Edge (Vertices K C)))
        (set BFGA (Color "Pink")) 
        (set AHKC (Color "Pink"))
        (Vertex (Pos 0.62 0.77) (Size 0.03 0.03) (Color "Bg") (Label "F")
          (FontColor "Fg"))
        (Vertex (Pos 0.43 0.77) (Size 0.03 0.03) (Color "Bg") (Label "G")
          (FontColor "Fg"))
        (Vertex (Pos 0.23 0.62) (Size 0.03 0.03) (Color "Bg") (Label "H")
          (FontColor "Fg"))
        (Vertex (Pos 0.23 0.38) (Size 0.03 0.03) (Color "Bg") (Label "K")
          (FontColor "Fg")))
    (defun RedLineAL ()
        (setq L (Vertex (Pos 0.746 0.378)))
        (Vertex (Pos 0.775 0.378) (Size 0.03 0.03) (Color "Bg") (Label "L")
          (FontColor "Fg"))
        (setq AL (Edge (Vertices A L) (Width thick) (Color "Red"))))
    (defun GreenLinesBDandCE ()
        (set BD (Width thick) (Color "Green"))
        (set EC (Width thick) (Color "Green")))
    (defun BlackLinesABandBDandCE ()
        (set BD (Width thin) (Color "Fg"))
        (set EC (Width thin) (Color "Fg"))
        (set AL (Width thin) (Color "Fg")))
    (defun TriangleABF ()
        (setq vt1 (Vertex (Pos 0.45 0.6)))
        (setq vt2 (Vertex (Pos 0.6 0.6)))
        (setq vt3 (Vertex (Pos 0.6 0.75)))
        (setq et12 (Edge (Vertices vt1 vt2) (Width verythin)))
        (setq et13 (Edge (Vertices vt1 vt3) (Width verythin)))
        (setq et23 (Edge (Vertices vt2 vt3) (Width verythin)))
        (setq t1 (Polygon (Vertices vt1 vt2 vt3) (Color "VeryLightBlue"))))
    (defun ShearABFtoCBF ()
        (Move (Elements vt1) (Path AC)))
    (defun GreenLineBF ()
        (set BF (Width thick) (Color "Green")))
    (defun ParallelLinesBFandCG ()
        (set BF (Width thin) (Color "Fg"))
        (setq p11 (Vertex (Pos 0.6 0)))
        (setq p12 (Vertex (Pos 0.6 1.0)))
        (setq p21 (Vertex (Pos 0.45 0)))
        (setq p22 (Vertex (Pos 0.45 1.0)))
        (setq p1 (Edge (Vertices p11 p12) (Width verythin) (Color "Red")))
        (setq p2 (Edge (Vertices p21 p22) (Width verythin) (Color "Red"))))
    (defun BlackLinesBFandCG ()
        (set p1 (Width 0))
        (set p2 (Width 0)))
    (defun GreenAngleCBD ()
        (setq ra1v1 (Vertex (Pos 0.57 0.56)))
        (setq ra1v2 (Vertex (Pos 0.64 0.57)))
        (setq ra1v3 (Vertex (Pos 0.61 0.53)))
        (setq ra11 (Edge (Vertices ra1v1 ra1v3) (Width med) (Color "Green")))
        (setq ra12 (Edge (Vertices ra1v2 ra1v3) (Width med) (Color "Green"))))
    (defun GreenAngleABF ()
        (setq ra2v1 (Vertex (Pos 0.55 0.60)))
        (setq ra2v2 (Vertex (Pos 0.60 0.65)))
        (setq ra2v3 (Vertex (Pos 0.55 0.65)))
        (setq ra21 (Edge (Vertices ra2v1 ra2v3) (Width med) (Color "Green")))
        (setq ra22 (Edge (Vertices ra2v2 ra2v3) (Width med) (Color "Green"))))
    (defun RedAngleABC ()
        (setq arc (Arc (Center B) (Radius 0.05) (Angle 1.2687e2 180)
                 (Width thick) (Color "Red"))))
    (defun ReplaceAnglesWithGreenCBF ()
        (set ra11 (Width 0))
        (set ra12 (Width 0))
        (set ra21 (Width 0))
        (set ra22 (Width 0))
        (set arc (Angle 1.2687e2 270)))
    (defun RotateCBF ()
        (Rotate (Center B) (Elements arc) (Angle -90)))
    (defun ClearAngle ()
      (set arc (Width 0)))
    (defun GreenLineBF2 ()
      (setq ve1 (Vertex (Pos 0.6 0.75)))
      (setq e1 (Edge (Vertices B ve1) (Width thick) (Color "Green"))))
    (defun RotateLineBF ()
       (Rotate (Center B) (Elements ve1) (Angle -90)))
    (defun MoveBFtoBC ()
        (Move (Elements ve1) (Path AC) (Animate nil)))
    (defun RotateLineBC () 
        (Rotate (Center B) (Elements ve1) (Angle -90)))
    (defun RemoveLineBC () 
      (set e1 (Width 0)))
    (defun RotateCBFtoDBA () 
       (Rotate (Center B) (Elements vt3 vt1) (Angle -90)))
    (defun ShearABDtoBDL ()
      (Move (Elements vt3) (Path AL)))
    (defun GreenLineBD ()
      (set BD (Width thick) (Color "Green")))
    (defun ParallelLinesBDandAL ()
        (set BD (Width thin) (Color "Fg"))
        (setq p11 (Vertex (Pos 0 1.05)))
        (setq p12 (Vertex (Pos 1.0 0.3)))
        (setq p21 (Vertex (Pos -0.15 1.05)))
        (setq p22 (Vertex (Pos 1.05  0.15)))
        (setq p1 (Edge (Vertices p11 p12) (Width verythin) (Color "Red")))
        (setq p2 (Edge (Vertices p21 p22) (Width verythin) (Color "Red"))))
    (defun ClearParallelLinesBDandAL ()
        (set p1 (Width 0))
        (set p2 (Width 0)))
    (defun ShowABF ()
        (set t1 (Color "Bg")) (set et23 (Width 0))
        (setq t2 (Polygon (Vertices A B F) (Color "VeryLightBlue")))
        (setq AF (Edge (Vertices A F) (Width verythin))))
    (defun ShowBDL ()
        (set t1 (Color "VeryLightBlue"))
        (set et23 (Width verythin)))
    (defun ReplaceABFandBDLwithABFG ()
        (setq X (Vertex (Pos 0.546 0.528)))
        (set BFGA (Color "VeryLightBlue"))
        (set t1 (Color "Bg") (Vertices X))
        (set et23 (Width 0))
        (set t2 (Color "Bg") (Vertices X))
        (set AF (Width 0)))
    (defun ShowBDLX ()
        (setq BL (Polygon (Vertices B D L X) (Color "VeryLightBlue"))))
    (defun ShowACK ()
        (set t1 (Color "Pink") (Vertices vt1 vt2 vt3))
        (set et23 (Width verythin))
        (Move (Elements vt1) (Pos 0.45 0.6) (Animate nil))
        (Move (Elements vt2) (Pos 0.45 0.4) (Animate nil))
        (Move (Elements vt3) (Pos 0.25 0.4) (Animate nil)))
    (defun ShearRotateShearACKtoCEL ()
        (Frame (Time 0 2) (Actions (Move (Elements vt1) (Path AB))))
        (Frame (Time 0 2) (Actions (Rotate (Center C) (Elements vt1 vt3) (Angle 90))))
        (Frame (Time 0 2) (Actions (Move (Elements vt3) (Path AL)))))
    (defun ReplaceCELwithACKH ()
        (set AHKC (Color"Pink")) (set t1 (Color "Bg"))
        (set et23 (Width 0)))
    (defun ShowCELX ()
        (set t1 (Color "Pink") (Vertices C E L X)))

(Graph (Aspect 1) (Time 0 1))
)