CSC151.01 2015S, Class 12: A Design Perspective
===============================================

_Overview_

* Preliminaries.
    * Admin.
    * Upcoming Work.
    * Extra Credit.
    * Questions.
    * Talk about quiz.
* Optimism
    * A bit about design.
    * A bit about color theory.
    * Exploring some images and design spaces.

Preliminaries
-------------

### Admin

* New partners!
* Mentor session Monday (tonight) at 7:00 p.m.
* Work returned (I hope): Quiz 3.
* Virtual machine somewhat available.  URL to be announced.  Get
  info on using it at
  <http://www.cs.grinnell.edu/~rebelsky/CSC151/UserGuide.md>

### Upcoming Work

* [Exam 1](../assignments/exam.01.html).
    * Exam due in electronic form due Tuesday at 10:30 p.m. (free extension
      until Wednesday at 10:30 p.m.).
    * Exam due in printed form Wednesday (free extension until Thursday
      at review time).
    * Required epilogue due Wednesday at 10:30 p.m. (free extension until
      Wednesday at 11:00 p.m.)
* No lab writeup for today!
* Today will be more of a discussion day.  That means we have time for
  questions on the exam and more at the beginning.
* Reading for Tuesday
    * [Raster Graphics: Images from Pixels and Colors](../readings/raster-reading.html)
    * [RGB Colors](../readings/rgb-reading.html)

### Extra Credit Opportunities

#### Academic 

* Education Film, Wednesday night
* TEDx Grinnell, February 21

#### Miscellaneous

* Read and comment on the new _Grinnell College Guide to Preventing,
  Reporting, and Responding to Sexual Harassment and Sexual 
  Misconduct_.  Angela Voos says that she would really like to know
  what kinds of things might go in an FAQ or instructional video
  about the reporting process.

#### Peer Support (Afternoon Section)

* Swimming, Conference Championships, February 13-15, The Osgood

### Recommended, But no EC

* 2 <3 GC day on Wednesday.

### Questions

_What's the difference between a drawing and an image?_

> A drawing is a conceptual thing; it's a collection of colored ellipses
  and rectangles.   An image, in contrast, is a reference to GIMP's
  rendering of something visual.

_How many tests is enough?_

> Make sure that you cover all the cases, but each test can cover multiple
  cases.  I would guess that ten *different* tests would suffice.

_Getting the rectangles on top of the image is challenging.  Any hints?_

> See the exam for hints.

_What's the relationship between `hshift-drawing` and `drawing-hshift`.

> It's just the order of parameters.
  `(hshift-drawing AMT DRAWING)` vs. `(drawing-hshift DRAWING AMT)`.
  It's a matter of taste which you use.

_Should we show you our experiments?_

> Yes.

> Copy from the interactions pane.  Paste into the definition pane.
  Select.  Then comment out with semicolons (under the Racket menu).

_Is there a procedure for finding the center of a shape?_

> Yes.

> <http://www.cs.grinnell.edu/~rebelsky/Courses/CSC151/2015S/labs/rackunit-drawings-lab.html>

> <http://www.cs.grinnell.edu/~rebelsky/Courses/CSC151/2015S/eboards.am/extra.03.html>

_Can we give you multiple versions of a procedure in the hope that you will find one more to your liking?_

> If you indicate that the less correct ones are incorrect, yes.

About Quiz 3
------------

Problem 1: Find the difference between a number and the square of its
square root

        (define error-root-squared
          (lambda (number)
            (- number (square (sqrt number)))))

        (define error-root-squared
          (lambda (x)
            (- x (* (sqrt x) (sqrt x)))))

        (define error-root-squared
          (lambda (val)
            (- val (expt (sqrt val) 2))))

* Remember: The thing you are subtracting from comes on the left.
* We use `display` rarely.

Problem 2: Given lots of weird code, figure out what it does.

    (define circ
      (hshift-drawing 0.5 (vshift-drawing 0.5 drawing-unit-circle)))

* Is this defining a procedure or a value or ...?  It's defining a value;
  a drawing.  We would need a lambda for it to be a procedure.
* When you are describing a drawing to someone else, you normally specify
  a variety of characteristics
    * Position: Left, top, bottom, right
    * Color
    * Type: Rectangle, Ellipse, Group
    * Height and width (given by scaling)
    * Center x and center y
* Given all of that, how would you describe circ?
    * A circle
    * Height and width of 1
    * Center at (0.5,0.5)
    * Top at 0, Left at 0, Bottom at 1, Right at 1


    (define shape
      (lambda (h v)
         (hshift-drawing h
                         (vshift-drawing v
                                         (hscale-drawing h
                                                         (vscale-drawing v
                                                                        circ))))))

* Is shape a value or a procedure?  It's a procedure - It has a lambda
* Inputs (type): Two real numbers
* Outputs (type): A drawing
* Sample call: (shape 30 70)
* First action: Vertically scale circ by 70.  Result is
  an ellipse, centered at (0.5,35), top is 0, left is 0.  
  Height is 70, width is 1.
* Second action. Horizontally scale by 30.  Result is an ellipse,
  centered at (15,35), top is 0, left is 0, height is 70, width is 30.
* Third action.  Vertically shift by 70.  Change top, bottom, center-y.
  Result is an ellipse, centered at (15,105), top is 70, left is 0, height is
  70, bottom is 140
* Fourth action.  Horizontally shift by 30.
  Results is an ellipse, centered at (45,105), top is 70, left is 30, height is 70, width is 30.

    (define munge!
      (lambda (image)
         (drawing-render! (shape (* 1/3 (image-width image))
                                 (* 1/3 (image-height image)))
                          image)))

* Procedure
* Inputs (type): image
* Outputs (type): image
* Sample input: 600 x 450 drawing.
* Compute 1/3 of width - 200
* Compute 1/3 of height - 150
* Call `(shape 200 150)`

A bit about design
------------------

A bit about color theory
------------------------

Exploring some images and design spaces
---------------------------------------

