home *** CD-ROM | disk | FTP | other *** search
- /* SinCosDemo.yax freeware v0.4 @ Ben Schaeffer1993
- Sine and cosine arrays in degrees, 0 to 360 inclusive. */
-
- /* modified by wouter */
-
- (array sin 361
- 0 4 9 13 18 22 27 31 36 40 44 49 53 58 62 66 71 75 79 83 88 92 96 100 104 108
- 112 116 120 124 128 132 136 139 143 147 150 154 158 161 165 168 171 175 178
- 181 184 187 190 193 196 199 202 204 207 210 212 215 217 219 222 224 226 228
- 230 232 234 236 237 239 241 242 243 245 246 247 248 249 250 251 252 253 254
- 254 255 255 255 256 256 256 256 256 256 256 255 255 255 254 254 253 252 251
- 250 249 248 247 246 245 243 242 241 239 237 236 234 232 230 228 226 224 222
- 219 217 215 212 210 207 204 202 199 196 193 190 187 184 181 178 175 171 168
- 165 161 158 154 150 147 143 139 136 132 128 124 120 116 112 108 104 100 96
- 92 88 83 79 75 71 66 62 58 53 49 44 40 36 31 27 22 18 13 9 4 0
- -4 -9 -13 -18 -22 -27 -31 -36 -40 -44 -49 -53 -58 -62 -66 -71 -75 -79 -83
- -88 -92 -96 -100 -104 -108 -112 -116 -120 -124 -128 -132 -136 -139 -143 -147
- -150 -154 -158 -161 -165 -168 -171 -175 -178 -181 -184 -187 -190 -193 -196
- -199 -202 -204 -207 -210 -212 -215 -217 -219 -222 -224 -226 -228 -230 -232
- -234 -236 -237 -239 -241 -242 -243 -245 -246 -247 -248 -249 -250 -251 -252
- -253 -254 -254 -255 -255 -255 -256 -256 -256 -256 -256 -256 -256 -255 -255
- -255 -254 -254 -253 -252 -251 -250 -249 -248 -247 -246 -245 -243 -242 -241
- -239 -237 -236 -234 -232 -230 -228 -226 -224 -222 -219 -217 -215 -212 -210
- -207 -204 -202 -199 -196 -193 -190 -187 -184 -181 -178 -175 -171 -168 -165
- -161 -158 -154 -150 -147 -143 -139 -136 -132 -128 -124 -120 -116 -112 -108
- -104 -100 -96 -92 -88 -83 -79 -75 -71 -66 -62 -58 -53 -49 -44 -40 -36 -31 -27
- -22 -18 -13 -9 -4 0
- )
-
- (defun cos (a) (sin (if (> a 270) (- a 270) (+ a 90))))
- (defun wait () (while (uneq (mouse) 0)))
-
- (window 0 0 600 180 'circle')
-
- (for n 0 360
- (line (+ 300 (/ (* 160 (cos n)) 256))
- (+ 95 (/ (* 75 (sin n)) 256))
- (+ 300 (/ (* 80 (cos n)) 256))
- (+ 95 (/ (* 37 (sin n)) 256)) n)
- )
-
- (for n 0 360
- (plot (+ 300 (/ (* 40 (cos n)) 256)) (+ 95 (/ (* 19 (sin n)) 256)) n)
- )
-
- (write 'click to continue')
- (wait)
- (while (eq (mouse) 0))
- (cls)
- (set m 181)
- (wait)
- (while (eq (mouse) 0)
- (for n 0 360
- (line (+ 300 (/ (* 160 (cos n)) 256))
- (+ 95 (/ (* 75 (sin (- 360 n))) 256))
- (+ 300 (/ (* 80 (cos n)) 256))
- (+ 95 (/ (* 37 (sin n)) 256)) 2)
- (line (+ 300 (/ (* 160 (cos m)) 256))
- (+ 95 (/ (* 75 (sin (- 360 m))) 256))
- (+ 300 (/ (* 80 (cos m)) 256))
- (+ 95 (/ (* 37 (sin m)) 256)) 1)
- (set m (+ m 1))
- (if (eq m 361) (set m 0))
- (if (uneq (mouse) 0) (exit))
- )
- )
-