;Author : Mohamed Choubane (Ofset)

(new-figure "Une belle Fractale")
(lets Numeric "a1" free 1 2 (acos 0))
(lets Numeric "a2" free 1 3 (- 0 (acos 0)))
(send a1 masked)
(send a2 masked)
(define (pythagore p1 p2 n)
(send p1 masked)
(send p2 masked)

    (let* (
   (p4 (Point "" rotation p2 p1 a1))
   (p3 (Point "" rotation p1 p2 a2))
   (s1 (Segment ""extremities p1 p2))      (s2 (Segment "" extremities p2 p3))
   (s3 (Segment "" extremities p3 p4))
   (s4 (Segment "" extremities p4 p1))
   (O (Point "" middle-2pts p3 p4))
   (M (Point "" rotation p3 O a1))
   (s5 (Segment "" extremities p4 M))
   (s6 (Segment "" extremities M p3)))
   (send p1 masked)
   (send p2 masked)
   (send p3 masked)
   (send p4 masked)
   (send O masked)
   (send M masked)          (if (> n 0)
   (begin
   (pythagore p4 M (- n 1))
   (pythagore M p3 (- n 1))))))

       (lets Point "A" free -5 0)
       (lets Point "B" free -2 0)
   ;(send A masked)
   ;(send B masked)
    (pythagore A B 10) 