Lec6ex

# Lec6ex - Lecture Examples(9/11 function DrawRect(a,b,L,W,c...

This preview shows pages 1–3. Sign up to view the full content.

Lecture Examples (9/11) function DrawRect(a,b,L,W,c) % Adds a rectangle to the current window. % Assumes hold is on. % The rectangle has vertices (a,b), (a+L,b), (a+L,b+W), % and (a,b+W) and color c where c is one of 'r', 'g', 'y', etc. function DrawDisk(xc,yc,r,c) % Adds a circular disk to the current window. % Assumes hold is on. % The disk has radius r, center(xc,yc) and % color c where c is one of 'r', 'g', 'y', etc. function DrawStar(xc,yc,r,c) % Adds a 5-pointed star to the current window. % Assumes hold is on. % The star has radius r, center(xc,yc) and % color c where c is one of 'r', 'g', 'y', etc. % Script ShowAll % Illustrates DrawRect, DrawDisk, and DrawStar close all figure axis equal off hold on DrawRect(-1,-1,2,2, 'k' ) DrawDisk(0,0,1, 'm' ) DrawStar(0,0,1, 'y' ) hold off shg

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
% Script StarArray % Draws a blue 12-by-6 rectangle with lower left % corner at (0,0), % and then white radius 1 stars with centers at % % (2,4), (4,4), (6,4), (8,4) (10,4) % (2,2), (4,2), (6,2), (8,2) (10,2)
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/28/2008 for the course CS 100 taught by Professor Fan/vanloan during the Fall '07 term at Cornell.

### Page1 / 4

Lec6ex - Lecture Examples(9/11 function DrawRect(a,b,L,W,c...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online