summaryrefslogtreecommitdiff
path: root/tests/sincos.bth
blob: 7f6a13520e4dbf5f83aa2b7e90ff74bd57dc40a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
(defn (ts x)
  (* 10 (+ 1 (sin x))))
(defn (tc x)
  (* 10 (+ 1 (cos x))))
(set! _G_ts ts)
(set! _G_tc tc)

(defn (min x y)
  (if (< x y) x y))
(defn (max x y)
  (if (< x y) y x))
(set! _G_min min)
(set! _G_max max)

(defn (ws n)
  (for (i (- n 1)) (write " "))
  (say 'x))
(set! _G_ws ws)

(defn (p2 t)
  (let (s (_G_ts t)
        c (_G_tc t)
        fs (floor s)
        fc (floor c)
        m (_G_min fs fc)
        M (_G_max fs fc)
        d (- M m))
    (if (= 0 d)
      (_G_ws m)
      (do (_G_ws m) (_G_ws d)))))

      



(for (i 100) (p2 (/ i 16)))