DOC PREVIEW
MIT 6 001 - Lecture 9: Henderson Picture Language

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

6.090, Building Programming ExperienceBen VandiverLecture 9: Henderson Picture LanguageLecture 9 involved defining frames (using vectors) and creating images that w could manipulate (by flipping over, altering coordinates, etc.). The file needed for this is called lec9.scm. It needs to be unzipped and the folders included in the file, one called “bpe” and one called “images”, should be in the directory C:\u6001. If they aren’t, place them there (copy/paste), or many of the load commands evaluated in scheme won’t work. The two files we will be working with are called hutils.scm and ps4go.scm. Procedures in hutils.scm must be completed before ps4go.scm can be used. Both must be opened in scheme (C-x, C-f  then type in hutils.scm or ps4go.scm, depending on which file you wish to open. M-o evaluates everything at once in an open file)We can create a frame by specifying two vectors. The center point of the picture shown below is represented by (0.5, 0.5). We can draw pictures in the frame and specify the frame. (0, 1) (0, 0) (1, 0)Manipulate the picture by specifying the coordinate frame. Listing (0, 0), (1, 0), and (0, 1) in that order gives the frame above. That is origin, edge 1, and edge 2.We can flip the image (0, 1) (1, 1) (0, 0)or distort it.Picture not piece of data; it is a procedure. Give it one of the coordinate frames and it draws the image in that frame.Painter is a procedure that takes in a frame and outputs an image. You can manipulate procedures. (define make-vect list) The above is equivalent to (define (make-vect x y) (list x y))Write a procedure (in lec9.scm, ps4go.scm) to flip an image horizontally. (1, 1)(0, 0) (1, 0)Below has a new origin at (1, 0), a new vector 1 at (0, 0), and a new vector 2 at (1, 1) (1, 1)6.090, Building Programming Experience Lecture 9Ben Vandiver Page 2 of 3(0, 0) (1, 0)The image above has been flipped horizontally and demonstrates the idea behind the procedure. 6.090, Building Programming Experience Lecture 9Ben Vandiver Page 3 of


View Full Document

MIT 6 001 - Lecture 9: Henderson Picture Language

Documents in this Course
Quiz 1

Quiz 1

6 pages

Databases

Databases

12 pages

rec20

rec20

2 pages

Quiz II

Quiz II

15 pages

Streams

Streams

5 pages

Load more
Download Lecture 9: Henderson Picture Language
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 9: Henderson Picture Language and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 9: Henderson Picture Language 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?