(message " This is the \"answer key\" for quiz 1, multivariate calculus ") (message " Problem 1: plotting points: ") (data points (1 -1 2) (-1 2 1) (-2 1 -2)) ;; (plot points) doesn't work, because it understands by this a collection of ;; x-coordinates, y-coordinates, and z-coordinates (title "Three points") (plot (xs points) (ys points) (zs points) ) (send my-plot :showing-axes nil) (message " Problem 2: distance between points: ") (data points (1 2 3) (3 2 1) (1 1 0)) (func distance (x y) sqrt (sum ((x - y) ^ 2))) ; operates component-wise (print (distance (first points) (second points))) (print (distance (first points) (third points))) (print (distance (third points) (second points))) (print "second and third is smallest") (message " Problem 3: plotting functions and cross-sections ") (func f(x y) x ^ 2 - y) (title "f(x y)=x ^ 2 - y") (spin-domain -3 3 -3 3) (spin-points 20) (plot f) (send my-plot :showing-axes nil) (title "Cross-section for x=1") (section f 1 1) (plot my-func -3 3) (title "Cross-section for y=-1") (section f 2 -1) (plot my-func -3 3) (domain -3 3) (range -3 12) (animate f (grid -3 3 11) :loops 3) (func f(y x) x ^ 2 - y) (animate f (grid -3 3 11) :loops 3) (new-plot)