Lecture 7 Notes

# 2 stop when radius 1 6 21314 preliminary

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ‘w’ ‘k’ ‘r’ ‘b’ ‘g’ ‘y’ ‘m’ ‘c’ Ques,on Time What is the area of the red region? for k=1:3 if rem(k,2)==1 DrawRect(0,0,k,k,’r’) else DrawRect(0,0,k,k,’w’) end end A. 1 B. 3 C. 6 % red % white D. 9 doc colorSpec for all the details Insight Through Compu,ng Insight Through Compu,ng 5 2/13/14 DrawDisk DrawDisk(-1,-2,6,’m’) - 1 - 2 DrawDisk 6 DrawDisk( 6 , , , ) (- 1,- 2) ‘m’ A magenta disk with radius 6 & center at (- 1,- 2) Output Input Insight Through Compu,ng Coordinates of center color radius Insight Through Compu,ng DrawStar DrawStar(-1,-2,6,’g’) - 1 - 2 DrawStar DrawDisk( 6 , , , ) 6 (- 1,- 2) ‘g’ A green star with radius 6 and center at (- 1,- 2) Output Input Insight Through Compu,ng Coordinates of center color radius Insight Through Compu,ng Now Let’s Solve a Problem Problem 2: Nested Stars Draw black square with center (0,0) & side 2.1 Draw radius 1 magenta...
View Full Document

## This document was uploaded on 03/11/2014 for the course CSCI 004 at Brown.

Ask a homework question - tutors are online