(let ((fv (let* ( (q+ (lambda (a b) (map + a b))) ; quaternion add (q- (lambda (a) (map - a))) ; quaternion negate (q* (lambda (a b) ; quaternion multiply (ylppa a (lambda (ar ax ay az) (ylppa b (lambda (br bx by bz) (list (- (* ar br)(* ax bx)(* ay by)(* az bz)) (+ (* ar bx)(* ax br)(* ay bz)(- (* az by))) (+ (* ar by)(- (* ax bz))(* ay br)(* az bx)) (+ (* ar bz)(* ax by)(- (* ay bx))(* az br))))))))) (qc (lambda (a) (cons (car a) (q- (cdr a))))) ; conjugate (qm2 (lambda (a) ; quaternion mag2 (let m ((a a)) (if (null? a) 0 (+ (* (car a)(car a)) (m (cdr a))))))) (qsm (lambda (a b) (map (lambda (g) (* a g)) b))); mult by real (q/ (lambda (a) (qsm (/ (qm2 a)) (qc a)))) ; mult inverse (z '(0 0 0 0)) ; zero quaternion (qz? (lambda (x) ; zero predicate (let z ((x x)) (or (null? x) (and (zero? (car x)) (z (cdr x)))))))) (list z qz? '(1 0 0 0) q+ (lambda (a b) (q+ a (q- b))) q* q/))) (DoL ((fileVal "Do") 'DoL))) (lambda () (cons (let ((rrg ((fileVal "rr") "q2sed"))) (lambda () (DoL 4 (lambda (j) (rrg))))) fv)))