CSC 160 Computer Programming for Non-Majors Lecture #3c: Working with Pictures (continued) Prof. Adam M. Wittenstein

Slides:



Advertisements
Similar presentations
I Spy! Shapes in our world.
Advertisements

Beginning to use the language of position. Four children stand in a row. Children discuss who is at the front/first in the row? Who is behind? Who is.
Working with images and scenes CS 5010 Program Design Paradigms “Bootcamp” Lesson 2.5 TexPoint fonts used in EMF. Read the TexPoint manual before you delete.
Lecture # 11 JavaScript Graphics. Scalable Vector Graphics (SVG) Scalable Vector Graphics (SVG), as the name implies, are - scalable (without pixelation):
 What we're going to do is break up a circle into little pieces, and then reassemble it into a shape that we know the area formula for...  Maybe you're.
Faculty of Sciences and Social Sciences HOPE Structured Problem Solving Object Oriented Concepts 2 Stewart Blakeway FML 213
CSC 160 Computer Programming for Non-Majors Lecture #3a: Stepper, Words, Sentences (continued) Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #9: Booleans Prof. Adam M. Wittenstein
Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.
CSC 160 Computer Programming for Non-Majors Lecture #4: Defining Variables Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Images: Another Form of Symbolic Data Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #5c: Functions with Images Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #8: Animations I Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #5: Defining Functions Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Chapter 2: Numbers, Expressions, and Simple Programs Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Chapter 6: Structures Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #11: Conditionals II Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #3: Calling Functions Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Draft Chapter: The UFO Example Prof. Adam M. Wittenstein
Higher-level PHP constructs for manipulating image files.
Exercise A) Find out how tock in that figure works manually. Enter expression expressions such as (tock 0) and (tock 1) into DrScheme's Interactions.
CSC 160 Computer Programming for Non-Majors Lecture #10: Conditionals I Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Section 1.2: Drawing a UFO Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Chapter 4: Conditional Expressions and Functions Prof. Adam M. Wittenstein
Four simple expressions in meta. Data objects Pieces of data in a computer are called objects Today, we’ll talk about four kinds of objects Numbers Pictures.
CSC 160 Computer Programming for Non-Majors Lecture #5b: Designing Programs Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #7: Variables Revisited Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Chapter 3: Programs are Functions Plus Variable Definitions Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #2: What are Functions? Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #3a: Stepper, Words, Sentences Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #5a: Defining Functions on Words and Sentences Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #6: Function Composition Prof. Adam M. Wittenstein
Programming with Images (continued). Another teachpack – “tiles.ss” Download from the website: “ Save.
CSC 160 Computer Programming for Non-Majors Lecture #3b: Working with Pictures Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #5 (continued): More on Writing Functions Prof. Adam M. Wittenstein
CSC 160 Computer Programming for Non-Majors Lecture #12: Syntax and Semantics Prof. Adam M. Wittenstein
Today we will derive and use the formula for the area of a triangle by comparing it with the formula for the area of a rectangle. derive = obtain or receive.
Computer Graphics Lecture 1 July 11, Computer Graphics What do you think of? The term “computer graphics” is a blanket term used to refer to the.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
CSC 160 Computer Programming for Non-Majors Chapter 8: Scheme Language Review Prof. Adam M. Wittenstein
Areas and Perimeter of Rectangles, Square, Triangles and Circles
Is this a square or a pentagon? It is a square.
Today we will be learning: to make models accurately to build solid shapes from cubes by following instructions.
Lab 7: Tree & Forest. Drawing a Forest Created by Emily Hill & Jerry Alan Fails.
Some Graphics CS303E: Elements of Computers and Programming.
Perimeter of Rectangles
Functional Programming Language 1 Scheme Language: part 2.
Teacher Miguel’s. For the month of November our focus was recognition of different shapes and colors. We look around the classroom and find different.
2D Perimeter and Area.
I can compare attributes of 2-dimensional figures with 3-dimensional figures by drawing and constructing nets and models.
CSC1401 Drawing in Java - 1. Goals Understand at a conceptual and practical level How to use the Turtle class to draw on a picture How to use the java.awt.Graphics.
DRAWING CHALLENGES IN MS WORD. GET READY Start MS Word Make sure you have the Home Tab selected You will be using these tools.
How many …?. What shape can you see? I can see some _____. Q1 Q1 stars.
7.3 Day One: Volumes by Slicing Find the volume of the pyramid: Consider a horizontal slice through the pyramid. s dh The volume of the slice is.
Area of a Rectangle = base x height
Sorting and Grouping.
Area of Shapes.
Name the shape below. rectangle rhombus square triangle A B C D
UNIT 8: 2-D MEASUREMENTS PERIMETER AREA SQUARE RECTANGLE PARALLELOGRAM
What shape am I? I am a plane shape. I have 4 sides.
Fractions 1/2 1/8 1/3 6/8 3/4.
Basics of Classification
Here are four triangles. What do all of these triangles have in common
How Many Colorful Shapes?
Introduction to Fractions
Barlogik Mathsbee (final)
Shapes.
Working with images and scenes
Spell your name using word art from above
2D Shapes Rectangle Circle Triangle Rectangle. What shape is the door? Rectangle.
Presentation transcript:

CSC 160 Computer Programming for Non-Majors Lecture #3c: Working with Pictures (continued) Prof. Adam M. Wittenstein

A preview of today… As a review of our first language rule (calling functions), we will look at some predefined functions from the “world.ss” teachpack. Then we will learn our second language rule, which is defining a variable.

I. The “world.ss” teachpack

Some “world.ss” functions Here are some functions to create shapes. --Wherever a function takes in a "mode", you may use either the symbol 'solid or the symbol 'outline. --Wherever a function takes in an “image-color”, you can enter a color with a string or a symbol. For example, ‘blue or ‘Blue or “blue” or “Blue”. rectangle num num mode image-color -> image circle num mode image-color -> image triangle num mode image-color -> image (NOTE: The triangle function is only for equilateral triangles.)

Exercise 1: Creating shapes Using the function rectangle. Have DrScheme draw a solid red rectangle that is 50 by 100. Have DrScheme draw a solid red rectangle that is 50 by 100. Using the function circle. Have DrScheme draw a solid red circle with a radius of 5. Have DrScheme draw a solid red circle with a radius of 5. Using the function triangle. Have DrScheme draw an outline of an green equilateral triangle with sides of 50 pixels each. Have DrScheme draw an outline of an green equilateral triangle with sides of 50 pixels each.

More “world.ss” functions image-width: image -> number image-height: image -> number overlay: image image... -> image

Exercise 2: More Image Functions Find the width and height of one of the shapes from Exercise 1. Find the width and height of one of the shapes from Exercise 1. Find the width and height of a picture from your computer or a website. Find the width and height of a picture from your computer or a website. Put a solid red circle with a radius of 5 on top of this picture. Put a solid red circle with a radius of 5 on top of this picture.

In summary… We have called (predefined) functions involving each of these data types: Mathematical: numbers, booleans Linguistic: words (a.k.a. symbols), sentences (a.k.a. strings) Images: pictures, shapes -- Next class, we will see how to define variables and functions.