home *** CD-ROM | disk | FTP | other *** search
- ; book pp.301-302
-
- (require "data/stackloss")
-
- (defun standardize (x)
- (let ((x-bar (mean x))
- (s (standard-deviation x)))
- (/ (- x x-bar) s)))
-
- (setf std-air (standardize air))
- (setf std-temp (standardize temp))
- (setf std-conc (standardize conc))
- (setf std-loss (standardize loss))
- (setf w (plot-points (list std-air std-conc std-loss std-temp)
- :scale-type 'fixed))
-
- (defun interpolate (p)
- (let* ((alpha (* (/ pi 2) p))
- (s (sin alpha))
- (c (cos alpha))
- (m (make-array '(4 4) :initial-element 0)))
- (setf (aref m 0 0) c)
- (setf (aref m 0 2) s)
- (setf (aref m 1 1) c)
- (setf (aref m 1 3) s)
- (send w :transformation m)))
- (setf slider (interval-slider-dialog '(0 1) :action #'interpolate))
-
- (send w :add-subordinate slider)
-