Ignore:
Timestamp:
04/01/14 11:13:16 (7 years ago)
Author:
Ivan Raikov
Message:

parametric-curve: more work on fold routines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/parametric-curve/trunk/tests/run.scm

    r30629 r30630  
    4949               ((sample-curve my-scaled-c) 1.)
    5050               (list 4. 5. 5.)))
    51 
    52 (assert (every (lambda (x y) (print (abs (- x y))) (< (abs (- x y)) machine-epsilon))
    53                ((sample-curve my-c) 5) (list 3. 4. 5.)))
    54 
    5551(assert (every
    5652         (lambda (xv yv) (map (lambda (x y) (< (abs (- x y)) machine-epsilon))
     
    6258               )))
    6359
    64 (assert (every (lambda (x y) (< (abs (- x y)) machine-epsilon))
    65                ((sample-curve my-scaled-c) 5) (list 3. 4. 25.)))
     60(assert (every (lambda (x y)
     61                 (printf "x = ~A y = ~A abs (x-y) = ~A~%" x y (abs (- x y) ))
     62                 (< (abs (- x y)) machine-epsilon))
     63               (list 8. 9. 25.)
     64               ((sample-curve my-scaled-c) 5)
     65               ))
     66
    6667(assert (every
    6768         (lambda (xv yv) (map (lambda (x y) (< (abs (- x y)) machine-epsilon))
     
    7677
    7778(printf "iterate my-scaled-c = ~A~%" (iterate-curve my-scaled-c 5))
     79
     80
     81(printf "fold my-scaled-c = ~A~%"
     82        (fold-curve my-scaled-c 5
     83           (list (lambda (x init) (* x 10))
     84                 (lambda (x init) (* x 20))
     85                 (lambda (x init) (* x 30)))
     86           (list '() '() '())
     87           ))
     88
    7889
    7990(define s (line-segment 3 (list 1 2 3)))
     
    128139(define segrz (line-segment 3 (transform (Rz 60) (list 1 1 1))))
    129140(printf "z rotated segment (0,1) = ~A~%" ((sample-curve* segrz) (list 0 0.5 1)))
    130 
Note: See TracChangeset for help on using the changeset viewer.