Mrs. North's Shoes Reduced Proportionally


The left shows what happens when the proportion problem is solved incorrectly - IT WARPS.
The right shows the orginal digital picture at 640 x 480 pixels.


The following is the Scheme program which will calculate the correct proportion:

;;webPicture:  number -> number
;;design proportional pictures by computing height of picture
(define ratioWtoH 640/480)
(define (webPicture height)
  (/ height ratioWtoH))

(webPicture 200) = 150
(webPicture 300) = 225
(webPicture 111.0) = #i83.25

Back to Mrs. North's Lesson Page