Project 2 Function Plotter Mon, Sep 22, 2003 Due Mon, Sep 29, 2003.

Slides:



Advertisements
Similar presentations
GRAPHING TRIGONOMETRIC FUNCTIONS
Advertisements

Intro to Computers!.
Working with Profiles in IX1D v 3 – A Tutorial © 2006 Interpex Limited All rights reserved Version 1.0.
Activity Set 3.2 PREP PPTX Visual Algebra for Teachers.
Matlab Graphics S. Awad, Ph.D. M. Corless, M.S.E.E. E.C.E. Department University of Michigan-Dearborn Introduction to Matlab: 2D Graphics.
Chapter 5 Multitable Forms
XP Tutorial 4 New Perspectives on Microsoft Windows XP 1 Microsoft Windows XP Personalizing Your Windows Environment Tutorial 4.
Clipping Lines Lecture 7 Wed, Sep 10, The Graphics Pipeline From time to time we will discuss the graphics pipeline. The graphics pipeline is the.
Computer Basics. Using a computer The purpose of this class is to get comfortable with: Using Windows.
Introduction Many relationships can be represented by linear equations. Linear equations in two variables can be written in the form y = mx + b, where.
© by Pearson Education, Inc. All Rights Reserved. continued …
Introduction Earlier we studied the circle, which is the set of all points in a plane that are equidistant from a given point in that plane. We have investigated.
Graphing Linear Equations From the beginning. All the slides in this presentation are timed. You do not need to click the mouse or press any keys on the.
Module 3 Productivity Programs Common Features and Commands Microsoft Office 2007.
Polar Form and Complex Numbers. In a rectangular coordinate system, There is an x and a y-axis. In polar coordinates, there is one axis, called the polar.
Using Graphics Libraries Lecture 3 Mon, Sep 1, 2003.
Introduction A step function is a function that is a series of disconnected constant functions. This type of function is also referred to as a stair.
Setting Up Clear any equations or lists from your calculator to start! Clear any equations or lists from your calculator to start! ~From the Y= list ~From.
Microsoft PowerPoint Getting Started Guide Prepared for Towson University Dr. Jeff M. Kenton Amy Chase Martin 2007.
Events and Coordinates Lecture 5 Fri, Sep 5, 2003.
Section 1.1 Graphs and Graphing Utilities. Points and Ordered Pairs.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
FUNCTIONS AND MODELS 1. In this section, we assume that you have access to a graphing calculator or a computer with graphing software. FUNCTIONS AND MODELS.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
REVIEW Math 1113 Precalculus Fall 2010 Instructor: Ayona Chatterjee.
Productivity Programs Common Features and Commands.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Office Basics
1 After completing this lesson, you will be able to: Start Access and open an existing database. Move around in Access. Open and close a table. (continued)
Introduction to Microsoft publisher
Microsoft Publisher 2010 Chapter 1 Creating a Flyer.
Functions. Evaluating Functions Graphing Functions.
CS130 Project 1 A simple VB application ("project" or program): user enters amount of sales then clicks the "Calculate button", the application displays.
Histograms Lecture 14 Sec Tue, Sep 26, 2006.
13-5 The cosine Function Today’s Objective: I can graph the cosine function.
TI-83 An Introduction to Graphing Mathematics Staff Development Lincoln Public Schools August 25, 2005 © Jerel L. Welker
Functions and Models 1. Graphing Calculators and Computers 1.4.
Chapter 4.1: Scatter Plots. Lesson 4.1: Scatter Plots.
13-4 The Sine Function Today’s Objective: I can graph the sine function.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
Introduction In order to fully understand how various functions model real-world contexts, we need to understand how changing parameters will affect the.
Histograms Lecture 14 Sec Fri, Feb 8, 2008.
Algebra 1cc Functions 3 Determine the domain and range of a function from its graph Recall: the domain of a function is its independent or x values. The.
Application software- programs that let you do things What are some computer programs that you or your parents use on the computer?
Histograms Lecture 18 Sec Tue, Feb 17, 2004.
Ch : Which Values Are Possible? Domain & Range.
Example 7 U.S. Executions Chapter 1.2 The table gives the number of executions in the United States for selected years from 1984 to (Source: “The.
Introduction In this lesson, different methods will be used to graph lines and analyze the features of the graph. In a linear function, the graph is a.
Chapter 3 Modeling Distributions of Data. The standard Normal distribution the Normal distribution with mean 0 and standard deviation 1 z has the standard.
Histograms Lecture 14 Sec Wed, Sep 29, 2004.
An equation whose variables are polar coordinates is called a polar equation. The graph of a polar equation consists of all points whose polar coordinates.
Microsoft Office 2013 ®® Exploring the Basics of Windows 8.
Objective – Students will be able to investigate graphs with different viewing windows or viewing screens. Therefore learning how important it is to choose.
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
Weighing Pennies Graph the following data in a histogram comment on the shape, center, spread, and anything unusual. Change your window (xmin 2.4 xmax.
Section 1.1 Graphs and Graphing Utilities
Graphing Linear Equations
Enhancing Forms with OLE Fields, Hyperlinks, and Subforms
Section 1.1 Graphs and Graphing Utilities
Section 1.1 Graphs and Graphing Utilities
Graphing Calculator Lesson 1: Graphing Lines and Finding Intercepts
1.4 Graphing Calculators and Computers
Introduction Solving a linear inequality in two variables is similar to graphing a linear equation, with a few extra steps that will be explained on the.
Displaying Distributions – Quantitative Variables
2D Graphics Lecture 4 Fri, Aug 31, 2007.
Histograms Lecture 14 Sec Fri, Feb 8, 2008.
The Real Zeros of a Polynomial Function
The Real Zeros of a Polynomial Function
Presentation transcript:

Project 2 Function Plotter Mon, Sep 22, 2003 Due Mon, Sep 29, 2003

Function Plotter Read the handout.handout Download the files. FunctionPlotter.cpp. FunctionPlotter.cpp point2.h. point2.h Run the demo.demo

Function Plotter Your job is to write most of the callback functions. display() reshape() mouse() keyboard() special()

The Display Function This function will draw the graphs of the functions. Show each function from xmin to xmax. Show a function only if it is selected to be shown (see func[i].show). Draw the function in the appropriate color (see func[i].color[3]).

The Reshape Function When the window is resized, you must compute new values for xmax and ymin. Recall that the upper-left corner remains fixed when the window is resized. Therefore, xmin and ymax remain fixed.

The Mouse Function When the user right-clicks, the window should be re-centered on the point on which he clicked. You must compute new values for xmin, xmax, ymin, and ymax. This changes the boundaries, but not the scale.

The Keyboard Function When the user presses ‘+’ (or shift-‘+’), the program zooms in towards the center point. When the user presses ‘–’ (or shift-‘–’), the program zooms out from the center point. In either case, the center point remains fixed. You must compute new values for xmin, xmax, ymin, and ymax. These operations change the boundaries and the scale.

The Special Function When the user presses the arrow keys, the program should shift the window up, down, left, or right. If you shift up or down, you must compute new values for ymin and ymax. If you shift left or right, you must compute new values for xmin and xmax. These operations change the boundaries, but not the scale.

The Special Function Pressing the up arrow key should move the “viewpoint” up. Therefore, the graph will move down. Similarly for the other arrow keys. This is consistent with scrolling in other applications.

The Function Values The function values are stored in a two- dimensional array p of points. func[i].pt[j] is the j-th point of the i-th function. Thus, the x- and y-coordinates are func[i].pt[j].x and func[i].pt[j].y. The values are computed in a function called computeFuncs().

The Function Values It is your responsibility to call on computeFuncs() as necessary. Generally, whenever xmin, xmax, ymin, or ymax changes, you need to recompute the function values.

The Functions to be Plotted Ten functions are provided already, but you are free to change them. You should stick with functions whose domain is all real numbers since the program makes no attempt to determine ahead of time whether f(x) can be computed for a given x. For example, f(x) = 1/x might cause trouble if x = 0.

The Array of Function Structs The program creates an array of structures (structs) to hold the function information. We cannot store a function itself in a struct, so we must store a pointer to the function.

The Array of Function Structs The array of structs is defined as struct { float (*f)(float); Point2* pt; float color[3]; bool show; } func[NUM_FUNCS];

The Array of Function Structs It is initialized as { {sin, NULL, {1, 0, 0}, true}, {cos, NULL, {0, 1, 0}, false}, {sinPlusCos, NULL, {0, 0, 1}, false}, {twoSin2x, NULL, {0, 1, 1}, false}, {cubic, NULL, {1, 0, 1}, false}, {piecewise, NULL, {1, 0.5, 0}, false}, {rational, NULL, {0, 0.5, 0}, false}, {rational2, NULL, {0.9, 0.9, 0}, false}, {cosh, NULL, {.68,.56,.25}, false}, {sinh, NULL, {0, 0, 0}, false} };