File A: Edited version vtkimagedrawroi.cxx. File B: Current release vtkimagedrawroi.cxx. vtkimagedrawroi::vtkimagedrawroi() { this->hideroioff();

Size: px
Start display at page:

Download "File A: Edited version vtkimagedrawroi.cxx. File B: Current release vtkimagedrawroi.cxx. vtkimagedrawroi::vtkimagedrawroi() { this->hideroioff();"

Transcription

1 File A: Edited version vtkimagedrawroi.cxx vtkimagedrawroi::vtkimagedrawroi() this->hideroioff(); this->firstpoint = NULL; this->lastpoint = NULL; this->numpoints = 0; this->numselectedpoints = 0; this->pointradius = 1; this->pointcolor[0] = 1; this->pointcolor[1] = 0; this->pointcolor[2] = 0; this->selectedpointcolor[0] = 1; this->selectedpointcolor[1] = 1; this->selectedpointcolor[2] = 0; this->linecolor[0] = 1; this->linecolor[1] = 0; this->linecolor[2] = 0; this->drawselectbox = 0; this->sbox.x = 0; this->sbox.y = 0; this->sbox1.x = 0; this->sbox1.y = 0; this->sbox2.x = 0; this->sbox2.y = 0; this->points = vtkpoints::new(); this->shape = ROI_SHAPE_POLYGON; this->image_reformat = NULL; File B: Current release vtkimagedrawroi.cxx vtkimagedrawroi::vtkimagedrawroi() this->hideroioff(); this->firstpoint = NULL; this->lastpoint = NULL; this->numpoints = 0; this->numselectedpoints = 0; this->pointradius = 1; this->pointcolor[0] = 1; this->pointcolor[1] = 0; this->pointcolor[2] = 0; this->selectedpointcolor[0] = 1; this->selectedpointcolor[1] = 1; this->selectedpointcolor[2] = 0; this->linecolor[0] = 1; this->linecolor[1] = 0; this->linecolor[2] = 0; this->drawselectbox = 0; this->sbox.x = 0; this->sbox.y = 0; this->sbox1.x = 0; this->sbox1.y = 0; this->sbox2.x = 0; this->sbox2.y = 0; this->points = vtkpoints::new(); this->shape = ROI_SHAPE_POLYGON;

2 void vtkimagedrawroi::appendpoint(int x, int y) if (image_reformat!=null) image_reformat->slice2ijk(x,y,p->x0, p->y0, p->z0); //<- if (this->firstpoint == NULL) this->firstpoint = p; this->lastpoint->next = p; void vtkimagedrawroi::appendpoint(int x, int y) if (this->firstpoint == NULL) this->firstpoint = p; this->lastpoint->next = p;

3 void vtkimagedrawroi::insertafterselectedpoint(int x, int y) Point *p1 = this->firstpoint; Point *p2 = NULL; Point *sel = NULL; // special case of empty list if (p1 == NULL) // Add and select new point if (image_reformat!=null) image_reformat->slice2ijk(x,y,p->x0, p->y0, p->z0); //<this->firstpoint = p; p->select(); this->numselectedpoints++; return; // p1 traverses list // p2 points to last point. p2 = p1; while (p1) if (p1->isselected()) sel = p1; p2 = p1; p1 = p1->getnext(); if (!sel) p2->select(); sel = p2; // Add new point p1 = sel; if (image_reformat!=null) image_reformat->slice2ijk(x,y,p->x0, p->y0, p->z0); //<- void vtkimagedrawroi::insertafterselectedpoint (int x, int y) Point *p1 = this->firstpoint; Point *p2 = NULL; Point *sel = NULL; // special case of empty list if (p1 == NULL) // Add and select new point this->firstpoint = p; p->select(); this->numselectedpoints++; return; // p1 traverses list // p2 points to last point. p2 = p1; while (p1) if (p1->isselected()) sel = p1; p2 = p1; p1 = p1->getnext(); if (!sel) p2->select(); sel = p2; // Add new point p1 = sel; p1->next = p; p->next = p2; // p2 = NULL if p1 is tail, that's ok if (!p2) // Select the new point instead of any others this->deselectallpoints(); p->select(); this->numselectedpoints++;

4 p1->next = p; p->next = p2; // p2 = NULL if p1 is tail, that's ok if (!p2) // Select the new point instead of any others this->deselectallpoints(); p->select(); this->numselectedpoints++;

5 void vtkimagedrawroi::moveselectedpoints(int deltax, int deltay) Point *p = this->firstpoint; while (p) if (p->isselected()) p->x += deltax; p->y += deltay; if (image_reformat!=null) image_reformat->slice2ijk(p->x,p->y,p->x0, p->y0, p->z0); void vtkimagedrawroi::moveselectedpoints(int deltax, int deltay) Point *p = this->firstpoint; while (p) if (p->isselected()) p->x += deltax; p->y += deltay;

6 void vtkimagedrawroi::drawlines (vtkimagedata *outdata, int outext[6]) unsigned char color[3]; Point *p1, *p2; long xmin, xmax, ymin, ymax; //fprintf(stderr,"drawlines\n"); ConvertColor(this->LineColor, color); p1 = this->firstpoint; if (!p1) return; if (image_reformat!=null) image_reformat->ijk2slice(p1->x0,p1->y0,p1->z0,p1->x,p1->y); while (p2!= NULL) if (image_reformat!=null) image_reformat->ijk2slice(p2->x0,p2->y0,p2->z0,p2->x,p2->y); //<- if (this->getshape() == ROI_SHAPE_POLYGON) if (p1->x >= xmin && p1->x <= xmax && p1->y >= ymin && p1->y <= ymax && p2->x >= xmin && p2->x <= xmax && p2->y >= ymin && p2->y <= ymax) DrawLine(p1->x, p1->y, p2->x, p2->y, color, outptr, nxnc, nc); void vtkimagedrawroi::drawlines(vtkimagedata *outdata, int outext[6]) unsigned char color[3]; Point *p1, *p2; long xmin, xmax, ymin, ymax; ConvertColor(this->LineColor, color); p1 = this->firstpoint; if (!p1) return; while (p2!= NULL) if (this->getshape() == ROI_SHAPE_POLYGON) if (p1->x >= xmin && p1->x <= xmax && p1->y >= ymin && p1->y <= ymax && p2->x >= xmin && p2->x <= xmax && p2->y >= ymin && p2->y <= ymax) DrawLine(p1->x, p1->y, p2->x, p2->y, color, outptr, nxnc, nc); if (p1->x-r >= xmin && p1->x+r <= xmax && p1->y-r >= ymin && p1->y+r <= ymax && p2->x-r >= xmin && p2->x+r <= xmax && p2->y-r >= ymin && p2->y+r <= ymax) DrawThickLine(p1->x, p1->y, p2->x, p2->y, color, outptr, nxnc, nc, r);

7 if (p1->x-r >= xmin && p1->x+r <= xmax && p1->y-r >= ymin && p1->y+r <= ymax && p2->x-r >= xmin && p2->x+r <= xmax && p2->y-r >= ymin && p2->y+r <= ymax) DrawThickLine(p1->x, p1->y, p2->x, p2->y, color, outptr, nxnc, nc, r); p1 = p2; p1 = p2;

8 void vtkimagedrawroi::drawcrosses(vtkimagedata *outdata, int outext[6]) int x, y, x1, x2, y1, y2; unsigned char color[3], *ptr; Point *p; int xmin, xmax, ymin, ymax; p = this->firstpoint; while (p) if (p->isselected()) ConvertColor(this->SelectedPointColor, color); ConvertColor(this->PointColor, color); if (image_reformat!=null) image_reformat->ijk2slice(p->x0,p->y0,p->z0,p->x,p->y); //<x1 = p->x - r; x2 = p->x + r; y1 = p->y - r; y2 = p->y + r; if (x1 >= xmin && x1 <= xmax && y1 >= ymin && y1 <= ymax && x2 >= xmin && x2 <= xmax && y2 >= ymin && y2 <= ymax) for(y = y1; y <= y2; y++) SET_PIXEL(p->x, y, color); for(x = x1; x <= x2; x++) SET_PIXEL(x, p->y, color); void vtkimagedrawroi::drawcrosses(vtkimagedata *outdata, int outext[6]) int x, y, x1, x2, y1, y2; unsigned char color[3], *ptr; Point *p; int xmin, xmax, ymin, ymax; p = this->firstpoint; while (p) if (p->isselected()) ConvertColor(this->SelectedPointColor, color); ConvertColor(this->PointColor, color); x1 = p->x - r; x2 = p->x + r; y1 = p->y - r; y2 = p->y + r; if (x1 >= xmin && x1 <= xmax && y1 >= ymin && y1 <= ymax && x2 >= xmin && x2 <= xmax && y2 >= ymin && y2 <= ymax) for(y = y1; y <= y2; y++) SET_PIXEL(p->x, y, color); for(x = x1; x <= x2; x++) SET_PIXEL(x, p->y, color);

9 void vtkimagedrawroi::drawboxes(vtkimagedata *outdata, int outext[6]) int x, y, x1, x2, y1, y2; unsigned char color[3], *ptr; Point *p; int xmin, xmax, ymin, ymax; p = this->firstpoint; while (p) if (p->isselected()) ConvertColor(this->SelectedPointColor, color); ConvertColor(this->PointColor, color); if (image_reformat!=null) image_reformat->ijk2slice(p->x0,p->y0,p->z0,p->x,p->y); //<x1 = p->x - r; x2 = p->x + r; y1 = p->y - r; y2 = p->y + r; if (x1 >= xmin && x1 <= xmax && y1 >= ymin && y1 <= ymax && x2 >= xmin && x2 <= xmax && y2 >= ymin && y2 <= ymax) for(y = y1; y <= y2; y++) SET_PIXEL(x1, y, color); SET_PIXEL(x2, y, color); for(x = x1; x <= x2; x++) SET_PIXEL(x, y1, color); SET_PIXEL(x, y2, color); void vtkimagedrawroi::drawboxes(vtkimagedata *outdata, int outext[6]) int x, y, x1, x2, y1, y2; unsigned char color[3], *ptr; Point *p; int xmin, xmax, ymin, ymax; p = this->firstpoint; while (p) if (p->isselected()) ConvertColor(this->SelectedPointColor, color); ConvertColor(this->PointColor, color); x1 = p->x - r; x2 = p->x + r; y1 = p->y - r; y2 = p->y + r; if (x1 >= xmin && x1 <= xmax && y1 >= ymin && y1 <= ymax && x2 >= xmin && x2 <= xmax && y2 >= ymin && y2 <= ymax) for(y = y1; y <= y2; y++) SET_PIXEL(x1, y, color); SET_PIXEL(x2, y, color); for(x = x1; x <= x2; x++) SET_PIXEL(x, y1, color); SET_PIXEL(x, y2, color);

10

Lesson 8 - Practice Problems

Lesson 8 - Practice Problems Lesson 8 - Practice Problems Section 8.1: A Case for the Quadratic Formula 1. For each quadratic equation below, show a graph in the space provided and circle the number and type of solution(s) to that

More information

PR Quadtree Implementation

PR Quadtree Implementation Implementation 1 Of course, the PR quadtree will be implemented as a formal Java generic. However, it may be somewhat less generic than the general BST discussed earlier. During insertion and search, it

More information

Section 1.6. Inverse Functions

Section 1.6. Inverse Functions Section 1.6 Inverse Functions Important Vocabulary Inverse function: Let f and g be two functions. If f(g(x)) = x in the domain of g and g(f(x) = x for every x in the domain of f, then g is the inverse

More information

Linked List using a Sentinel

Linked List using a Sentinel Linked List using a Sentinel Linked List.h / Linked List.h Using a sentinel for search Created by Enoch Hwang on 2/1/10. Copyright 2010 La Sierra University. All rights reserved. / #include

More information

CS475m - Computer Graphics. Lecture 1 : Rasterization Basics

CS475m - Computer Graphics. Lecture 1 : Rasterization Basics CS475m - Computer Graphics Lecture 1 : Rasterization Basics Image Formation Light Source Camera Image World Image Formation Light Source Incident Ray Camera Reflected Ray Image World Transmitted Ray Image

More information

Organizing and Summarizing Data

Organizing and Summarizing Data Section 2.2 9 Organizing and Summarizing Data Section 2.2 C H A P T E R 2 4 Example 2 (pg. 72) A Histogram for Discrete Data To create a histogram, you have two choices: 1): enter all the individual data

More information

Quadratics Functions: Review

Quadratics Functions: Review Quadratics Functions: Review Name Per Review outline Quadratic function general form: Quadratic function tables and graphs (parabolas) Important places on the parabola graph [see chart below] vertex (minimum

More information

COL106: Data Structures and Algorithms. Ragesh Jaiswal, IIT Delhi

COL106: Data Structures and Algorithms. Ragesh Jaiswal, IIT Delhi Stack and Queue How do we implement a Queue using Array? : A collection of nodes with linear ordering defined on them. Each node holds an element and points to the next node in the order. The first node

More information

CS210 Project 5 (Kd-Trees) Swami Iyer

CS210 Project 5 (Kd-Trees) Swami Iyer The purpose of this assignment is to create a symbol table data type whose keys are two-dimensional points. We ll use a 2d-tree to support efficient range search (find all the points contained in a query

More information

Chapter. Graph Solve. 9-1 Before Using Graph Solve 9-2 Analyzing a Function Graph 9-3 Graph Solve Precautions

Chapter. Graph Solve. 9-1 Before Using Graph Solve 9-2 Analyzing a Function Graph 9-3 Graph Solve Precautions Chapter Graph Solve You can use any of the following methods to analyze function graphs and approximate results. Root extraction Determination of the maximum and minimum Determination of the y-intercept

More information

Image Warping and Morphing

Image Warping and Morphing Image Warping and Morphing OUTLINE: Image Warping Morphing Beier and Neely s Morphing Method Image Warping Point processing and filtering don t move pixels around. Image warping = rearranging the pixels

More information

The parametric equation below represents a ball being thrown straight up. x(t) = 3 y(t) = 96t! 16t 2

The parametric equation below represents a ball being thrown straight up. x(t) = 3 y(t) = 96t! 16t 2 1 TASK 3.1.2: THROWING Solutions The parametric equation below represents a ball being thrown straight up. x(t) = 3 y(t) = 96t! 16t 2 1. What do you think the graph will look like? Make a sketch below.

More information

Characterization of Silent Stores

Characterization of Silent Stores Characterization of Silent Stores Gordon B.Bell Kevin M. Lepak Mikko H. Lipasti University of Wisconsin Madison http://www.ece.wisc.edu/~pharm Background Lepak, Lipasti: On the Value Locality of Store

More information

9/26/2018 Data Structure & Algorithm. Assignment04: 3 parts Quiz: recursion, insertionsort, trees Basic concept: Linked-List Priority queues Heaps

9/26/2018 Data Structure & Algorithm. Assignment04: 3 parts Quiz: recursion, insertionsort, trees Basic concept: Linked-List Priority queues Heaps 9/26/2018 Data Structure & Algorithm Assignment04: 3 parts Quiz: recursion, insertionsort, trees Basic concept: Linked-List Priority queues Heaps 1 Quiz 10 points (as stated in the first class meeting)

More information

CS 361 Computer Systems Fall 2017 Homework Assignment 4 - Inter-Process Communications & I/O

CS 361 Computer Systems Fall 2017 Homework Assignment 4 - Inter-Process Communications & I/O CS 361 Computer Systems Fall 2017 Homework Assignment 4 - Inter-Process Communications & I/O Overall Assignment For this assignment, you are to write three programs that will work together using inter-process

More information

Setting a Window - Finding One That Works. You can enter the dimensions of the graph by accessing button you will see a window like the one below.

Setting a Window - Finding One That Works. You can enter the dimensions of the graph by accessing button you will see a window like the one below. A. Overview 1. WINDOW Setting a Window - Finding One That Works You can enter the dimensions of the graph by accessing button you will see a window like the one below.. When you use this The Xmin and Xmax

More information

Tessellating Stencils. Liang Yuan, Yunquan Zhang, Peng Guo, Shan Huang SKL of Computer Architecture, ICT, CAS

Tessellating Stencils. Liang Yuan, Yunquan Zhang, Peng Guo, Shan Huang SKL of Computer Architecture, ICT, CAS Tessellating Stencils Liang Yuan, Yunquan Zhang, Peng Guo, Shan Huang SKL of Computer Architecture, ICT, CAS Outline Introduction Related work Tessellating Stencils Stencil Stencil Overview update each

More information

Chapter. Graph-to-Table

Chapter. Graph-to-Table Chapter Graph-to-Table With this function, the screen shows both a graph and a table. You can move a pointer around the graph and store its current coordinates inside the table whenever you want. This

More information

Math Calculus I

Math Calculus I Math 1592 - Calculus I A brief Introduction to the TI92/Voyage 200 Here we give a selection of TI commands that we will be using through this course. 1. Basic Commands solve If we type the following solve(x

More information

CS488 2D Graphics. Luc RENAMBOT

CS488 2D Graphics. Luc RENAMBOT CS488 2D Graphics Luc RENAMBOT 1 Topics Last time, hardware and frame buffer Now, how lines and polygons are drawn in the frame buffer. Then, how 2D and 3D models drawing into the frame buffer Then, more

More information

NOTE: If you are new to TABLE and GRAPH modes you may find it beneficial to first work through the worksheet 'Self-Guided_9860_TABLE-GRAPH'.

NOTE: If you are new to TABLE and GRAPH modes you may find it beneficial to first work through the worksheet 'Self-Guided_9860_TABLE-GRAPH'. The Circumference Sum Investigation A note to teachers: This is a 'quirky algebraic modelling' investigation. That is to say a 'quirky' problem, rather than 'real world' problem, generates the model. It

More information

Lesson 4 Exponential Functions I

Lesson 4 Exponential Functions I Lesson 4 Exponential Functions I Lesson 4 Exponential Functions I Exponential functions play a major role in our lives. Population growth and disease processes are real-world problems that involve exponential

More information

Math 7 Elementary Linear Algebra PLOTS and ROTATIONS

Math 7 Elementary Linear Algebra PLOTS and ROTATIONS Spring 2007 PLOTTING LINE SEGMENTS Math 7 Elementary Linear Algebra PLOTS and ROTATIONS Example 1: Suppose you wish to use MatLab to plot a line segment connecting two points in the xy-plane. Recall that

More information

C Pointers. 6th April 2017 Giulio Picierro

C Pointers. 6th April 2017 Giulio Picierro C Pointers 6th April 07 Giulio Picierro Functions Return type Function name Arguments list Function body int sum(int a, int b) { return a + b; } Return statement (return keyword

More information

Mesh generation using blockmesh. blockmesh

Mesh generation using blockmesh. blockmesh Mesh generation using blockmesh blockmesh blockmesh is a multi-block mesh generator. For simple geometries, the mesh generation utility blockmesh can be used. The mesh is generated from a dictionary file

More information

Linked Lists. private int num; // payload for the node private Node next; // pointer to the next node in the list }

Linked Lists. private int num; // payload for the node private Node next; // pointer to the next node in the list } Linked Lists Since a variable referencing an object just holds the address of the object in memory, we can link multiple objects together to form dynamic lists or other structures. In our case we will

More information

2.3. Graphing Calculators; Solving Equations and Inequalities Graphically

2.3. Graphing Calculators; Solving Equations and Inequalities Graphically 2.3 Graphing Calculators; Solving Equations and Inequalities Graphically Solving Equations and Inequalities Graphically To do this, we must first draw a graph using a graphing device, this is your TI-83/84

More information

Graphical Solutions (How to solve equations graphically; how to find intersection of two lines)

Graphical Solutions (How to solve equations graphically; how to find intersection of two lines) Graphical Solutions (How to solve equations graphically; how to find intersection of two lines) Dr. Gisela Acosta-Carr. (8-page document) Let us review: Solve the equation 2x + 1 = 7 algebraically. First,

More information

Chpt 1. Functions and Graphs. 1.1 Graphs and Graphing Utilities 1 /19

Chpt 1. Functions and Graphs. 1.1 Graphs and Graphing Utilities 1 /19 Chpt 1 Functions and Graphs 1.1 Graphs and Graphing Utilities 1 /19 Chpt 1 Homework 1.1 14, 18, 22, 24, 28, 42, 46, 52, 54, 56, 78, 79, 80, 82 2 /19 Objectives Functions and Graphs Plot points in the rectangular

More information

Plot f, x, x min, x max generates a plot of f as a function of x from x min to x max. Plot f 1, f 2,, x, x min, x max plots several functions f i.

Plot f, x, x min, x max generates a plot of f as a function of x from x min to x max. Plot f 1, f 2,, x, x min, x max plots several functions f i. HdPlot.nb In[]:=? Plot Plot f, x, x min, x max generates a plot of f as a function of x from x min to x max. Plot f, f,, x, x min, x max plots several functions f i. In[]:= Plot Sin 7 x Exp x ^, x,, 4.5

More information

Lines and Circles Guided Practice: Teacher Instructions

Lines and Circles Guided Practice: Teacher Instructions Lines and Circles Guided Practice: Teacher Instructions Overview 1. Together, as a class, go through the Lines and Circles Guided Practice (exercises 1-22) described below. 2. Then have student teams conduct

More information

Linear Data Structure

Linear Data Structure Linear Data Structure Definition A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array Linked List Stacks Queues Operations on linear Data Structures Traversal

More information

Lesson 11 Rational Functions

Lesson 11 Rational Functions Lesson 11 Rational Functions In this lesson, you will embark on a study of rational functions. These may be unlike any function you have ever seen. Rational functions look different because they are in

More information

AMCAT Automata Coding Sample Questions And Answers

AMCAT Automata Coding Sample Questions And Answers 1) Find the syntax error in the below code without modifying the logic. #include int main() float x = 1.1; switch (x) case 1: printf( Choice is 1 ); default: printf( Invalid choice ); return

More information

Statistics & Curve Fitting Tool

Statistics & Curve Fitting Tool Statistics & Curve Fitting Tool This tool allows you to store or edit a list of X and Y data pairs to statistically analyze it. Many statistic figures can be calculated and four models of curve-fitting

More information

Reminder: Affine Transformations. Viewing and Projection. Shear Transformations. Transformation Matrices in OpenGL. Specification via Ratios

Reminder: Affine Transformations. Viewing and Projection. Shear Transformations. Transformation Matrices in OpenGL. Specification via Ratios CSCI 420 Computer Graphics Lecture 6 Viewing and Projection Jernej Barbic University o Southern Caliornia Shear Transormation Camera Positioning Simple Parallel Projections Simple Perspective Projections

More information

Lesson 11 Practice Problems

Lesson 11 Practice Problems Name: Date: Lesson 11 Section 11.1: Characteristics of Rational Functions 1. Complete the table below. Function Domain a) = 4 6 2 b) = 8 + 2 3 9 c) = d) = 12 6 e) = 2 1 4 2 f) = 3 4 2 + 3 g) = 8 3 Page

More information

Lecture 8: Pointer Arithmetic (review) Endianness Functions and pointers

Lecture 8: Pointer Arithmetic (review) Endianness Functions and pointers CSE 30: Computer Organization and Systems Programming Lecture 8: Pointer Arithmetic (review) Endianness Functions and pointers Diba Mirza University of California, San Diego 1 Q: Which of the assignment

More information

UNIT 5 QUADRATIC FUNCTIONS Lesson 6: Analyzing Quadratic Functions Instruction

UNIT 5 QUADRATIC FUNCTIONS Lesson 6: Analyzing Quadratic Functions Instruction Prerequisite Skills This lesson requires the use of the following skills: factoring quadratic expressions finding the vertex of a quadratic function Introduction We have studied the key features of the

More information

Lecture No.04. Data Structures

Lecture No.04. Data Structures Lecture No.04 Data Structures Josephus Problem #include "CList.cpp" void main(int argc, char *argv[]) { CList list; int i, N=10, M=3; for(i=1; i

More information

Computer Graphics (CS 543) Lecture 9 (Part 2): Clipping. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics (CS 543) Lecture 9 (Part 2): Clipping. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI) Computer Graphics (CS 543) Lecture 9 (Part 2): Clipping Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI) OpenGL Stages After projection, several stages before objects drawn

More information

Data Structures. Lecture 04 Sohail Aslam AL 1

Data Structures. Lecture 04 Sohail Aslam AL 1 Data Structures Lecture 04 Sohail Aslam 1 C++ Code for Linked List // position current before the first // list element void start() { lastcurrentnode = headnode; currentnode = headnode; }; 2 C++ Code

More information

// Should be right for DVD steppers, but is not too important here const int stepsperrevolution = 48;

// Should be right for DVD steppers, but is not too important here const int stepsperrevolution = 48; /* https://www.youtube.com/watch?v=opz9rgmoipc */ #include #include #define LINE_BUFFER_LENGTH 512 char STEP = MICROSTEP ; // Servo position for Up and Down const int penzup = 50;

More information

Data Structures and Algorithms

Data Structures and Algorithms Data Structures and Algorithms First Semester 2017/2018 Linked Lists Eng. Anis Nazer Linked List ADT Is a list of nodes Each node has: data (can be any thing, int, char, Person, Point, day,...) link to

More information

Transformation Pipeline

Transformation Pipeline Transformation Pipeline Local (Object) Space Modeling World Space Clip Space Projection Eye Space Viewing Perspective divide NDC space Normalized l d Device Coordinatesd Viewport mapping Screen space Coordinate

More information

Computational Applications in Nuclear Astrophysics using Java Java course Lecture 3

Computational Applications in Nuclear Astrophysics using Java Java course Lecture 3 Computational Applications in Nuclear Astrophysics using Java Java course Lecture 3 Prepared for course 160410/411 Michael C. Kunkel m.kunkel@fz-juelich.de Materials taken from; docs.oracle.com Teach Yourself

More information

Clouds, biological growth, and coastlines are

Clouds, biological growth, and coastlines are L A B 11 KOCH SNOWFLAKE Fractals Clouds, biological growth, and coastlines are examples of real-life phenomena that seem too complex to be described using typical mathematical functions or relationships.

More information

Othello Game. First, to learn the rules of Othello and play online, you can go here:

Othello Game. First, to learn the rules of Othello and play online, you can go here: Othello Game As an example of implementing a computer player, let s use the game Othello as an example. We are not using Upthrust because that will be the topic for a homework assignment! First, to learn

More information

list-0.c * list-0.c * David J. Malan * * Demonstrates a linked list for numbers.

list-0.c * list-0.c * David J. Malan * * Demonstrates a linked list for numbers. list-0.c 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. list-0.c

More information

1 SAT-LIFE-GRID INTRO 1

1 SAT-LIFE-GRID INTRO 1 1 SAT-LIFE-GRID INTRO 1 May 19, 2018 at 02:31 1*. Intro. This program generates clauses for the transition relation from time 0 to time r in Conway s Game of Life (thus simulating r steps), on an m n grid,

More information

Pointers. Memory. void foo() { }//return

Pointers. Memory. void foo() { }//return Pointers Pointers Every location in memory has a unique number assigned to it called it s address A pointer is a variable that holds a memory address A pointer can be used to store an object or variable

More information

Tree traversals and binary trees

Tree traversals and binary trees Tree traversals and binary trees Comp Sci 1575 Data Structures Valgrind Execute valgrind followed by any flags you might want, and then your typical way to launch at the command line in Linux. Assuming

More information

Solution for Data Structure

Solution for Data Structure Solution for Data Structure May 2016 INDEX Q1 a 2-3 b 4 c. 4-6 d 7 Q2- a 8-12 b 12-14 Q3 a 15-18 b 18-22 Q4- a 22-35 B..N.A Q5 a 36-38 b N.A Q6- a 39-42 b 43 1 www.brainheaters.in Q1) Ans: (a) Define ADT

More information

FUNCTIONS AND MODELS

FUNCTIONS AND MODELS 1 FUNCTIONS AND MODELS FUNCTIONS AND MODELS In this section, we assume that you have access to a graphing calculator or a computer with graphing software. FUNCTIONS AND MODELS 1.4 Graphing Calculators

More information

Write a program that creates in the main function two linked lists of characters and fills them with the following values:

Write a program that creates in the main function two linked lists of characters and fills them with the following values: Write a program that creates in the main function two linked lists of characters and fills them with the following values: The first list will have 3 nodes with the following characters: A,B, and C. The

More information

Object-Oriented Concepts

Object-Oriented Concepts JAC444 - Lecture 3 Object-Oriented Concepts Segment 2 Inheritance 1 Classes Segment 2 Inheritance In this segment you will be learning about: Inheritance Overriding Final Methods and Classes Implementing

More information

Time series plots and phase plane plots Graphics

Time series plots and phase plane plots Graphics Time series plots and phase plane plots Graphics Feb. 4, 2009 Graphics for Scientific/Technical Computation Line Plots Contour Plots Surface Plots What type of plots do we want?... - Time series plots

More information

MATH SPEAK - TO BE UNDERSTOOD AND MEMORIZED DETERMINING THE INTERSECTIONS USING THE GRAPHING CALCULATOR

MATH SPEAK - TO BE UNDERSTOOD AND MEMORIZED DETERMINING THE INTERSECTIONS USING THE GRAPHING CALCULATOR FOM 11 T15 INTERSECTIONS & OPTIMIZATION PROBLEMS - 1 1 MATH SPEAK - TO BE UNDERSTOOD AND MEMORIZED 1) INTERSECTION = a set of coordinates of the point on the grid where two or more graphed lines touch

More information

Unit 4 Graphs of Trigonometric Functions - Classwork

Unit 4 Graphs of Trigonometric Functions - Classwork Unit Graphs of Trigonometric Functions - Classwork For each of the angles below, calculate the values of sin x and cos x ( decimal places) on the chart and graph the points on the graph below. x 0 o 30

More information

Spring 2008 Data Structures (CS301) LAB

Spring 2008 Data Structures (CS301) LAB Spring 2008 Data Structures (CS301) LAB Objectives The objectives of this LAB are, o Enabling students to implement Singly Linked List practically using c++ and adding more functionality in it. o Enabling

More information

Arduino Programming Part 3. EAS 199A Fall 2010

Arduino Programming Part 3. EAS 199A Fall 2010 Arduino Programming Part 3 EAS 199A Fall 2010 Overview Part I Circuits and code to control the speed of a small DC motor. Use potentiometer for dynamic user input. Use PWM output from Arduino to control

More information

Week 11: Motion Tracking

Week 11: Motion Tracking Week 11: Motion Tracking Motion Tracking is another approach for interactive application: when real-live object (e.g. human) is moving in front of a web-cam, its movement (including its center, size, etc)

More information

Graphing Polar equations.notebook January 10, 2014

Graphing Polar equations.notebook January 10, 2014 graphing polar equations Ch.8 Lesson 2 1 2 3 4 Target Agenda Purpose Evaluation TSWBAT: convert equations to polar, graph a polar equation on the polar plane by recognizing the forms Warm-Up/Homework Check

More information

Common Misunderstandings from Exam 1 Material

Common Misunderstandings from Exam 1 Material Common Misunderstandings from Exam 1 Material Kyle Dewey Stack and Heap Allocation with Pointers char c = c ; char* p1 = malloc(sizeof(char)); char** p2 = &p1; Where is c allocated? Where is p1 itself

More information

3.1 The Inverse Sine, Cosine, and Tangent Functions

3.1 The Inverse Sine, Cosine, and Tangent Functions 3.1 The Inverse Sine, Cosine, and Tangent Functions Let s look at f(x) = sin x The domain is all real numbers (which will represent angles). The range is the set of real numbers where -1 sin x 1. However,

More information

Programming in C. Lecture 5: Aliasing, Graphs, and Deallocation. Dr Neel Krishnaswami. Michaelmas Term University of Cambridge

Programming in C. Lecture 5: Aliasing, Graphs, and Deallocation. Dr Neel Krishnaswami. Michaelmas Term University of Cambridge Programming in C Lecture 5: Aliasing, Graphs, and Deallocation Dr Neel Krishnaswami University of Cambridge Michaelmas Term 2017-2018 1 / 20 The C API for Dynamic Memory Allocation void *malloc(size_t

More information

Chapter. Table & Graph

Chapter. Table & Graph Chapter 15 Table & Graph With Table & Graph, you can generate tables of discreet data from functions and recursion formulas, and then use the values for graphing. Because of this, Table & Graph makes it

More information

LINEAR FUNCTIONS WITH LITERATURE BOOKS

LINEAR FUNCTIONS WITH LITERATURE BOOKS LINEAR FUNCTIONS WITH LITERATURE BOOKS Book: There Were Ten in the Den by John Butler 1.) Give a short synopsis of the story. Ten sleepy animals snuggle together for the night in their warm and cozy den,

More information

Lecture 4: Outline. Arrays. I. Pointers II. III. Pointer arithmetic IV. Strings

Lecture 4: Outline. Arrays. I. Pointers II. III. Pointer arithmetic IV. Strings Lecture 4: Outline I. Pointers A. Accessing data objects using pointers B. Type casting with pointers C. Difference with Java references D. Pointer pitfalls E. Use case II. Arrays A. Representation in

More information

/* SPECIFY ARCPLOT DISPLAY CONFIGURATION &IF %.MapsPerFrame% EQ 1 OR %.MapsPerFrame% EQ 4 &THEN &DO DISPLAY 9999 SIZE CANVAS /* Landscape

/* SPECIFY ARCPLOT DISPLAY CONFIGURATION &IF %.MapsPerFrame% EQ 1 OR %.MapsPerFrame% EQ 4 &THEN &DO DISPLAY 9999 SIZE CANVAS /* Landscape APdisplay.aml (1/7) ############ APDISPLAY.AML ################### PURPOSE: Displays different thematic map series in AP. Legends are displayed, with the key files being generated automatically if they

More information

This version of flowvc is capable of reading in 2D or 3D velocity data and

This version of flowvc is capable of reading in 2D or 3D velocity data and 1 Capabilities This version of flowvc is capable of reading in 2D or 3D velocity data and 1. Computing FTLE fields, 2. Computing tracer/particle trajectories, 3. Interpolating the velocity data onto another

More information

GRAPHING CALCULATOR - WINDOW SIZING

GRAPHING CALCULATOR - WINDOW SIZING Section 1.1 GRAPHING CALCULATOR - WINDOW SIZING WINDOW BUTTON. Xmin= Xmax= Xscl= Ymin= Ymax= Yscl= Xres=resolution, smaller number= clearer graph Larger number=quicker graphing Xscl=5, Yscal=1 Xscl=10,

More information

1 SAT-LIFE-UPPER INTRO 1

1 SAT-LIFE-UPPER INTRO 1 1 SAT-LIFE-UPPER INTRO 1 May 19, 2018 at 02:31 1*. Intro. This program generates clauses for the transition relation from time t to time t + 1 in Conway s Game of Life, for various values of t, as I m

More information

Intermediate Programming, Spring 2017*

Intermediate Programming, Spring 2017* 600.120 Intermediate Programming, Spring 2017* Misha Kazhdan *Much of the code in these examples is not commented because it would otherwise not fit on the slides. This is bad coding practice in general

More information

OpenEXR File Layout. Last Update: 04/24/07

OpenEXR File Layout. Last Update: 04/24/07 OpenEXR File Layout Last Update: 04/24/07 This document gives an overview of the layout of OpenEXR image files as byte sequences. The text assumes that the reader is familiar with OpenEXR terms such as

More information

Lesson 8 Practice Problems

Lesson 8 Practice Problems Name: Date: Lesson 8 Skills Practice 1. Plot and label the points. A. (8, 2) B. (0, 0) C. (0, 5) D. (10, 10) E. ( 4, 4) F. ( 9, 1) G. ( 5, 0) H. (2, 8) 2. Give the coordinates of each of the points shown

More information

Advanced Systems Programming

Advanced Systems Programming Advanced Systems Programming Introduction to C++ Martin Küttler September 19, 2017 1 / 18 About this presentation This presentation is not about learning programming or every C++ feature. It is a short

More information

Learning to Program with Haiku

Learning to Program with Haiku Learning to Program with Haiku Lesson 3 Written by DarkWyrm All material 2010 DarkWyrm So far we've been learning about programming basics, such as how to write a function and how to start looking for

More information

Image Warping and Morphing

Image Warping and Morphing Image Warping and Morphing Paul Heckbert, Sept. 1999 15-869, Image-Based Modeling and Rendering Image Warping Image warping = rearranging the pixels of a picture. Also called image distortion, geometric

More information

Clipping and Scan Conversion

Clipping and Scan Conversion 15-462 Computer Graphics I Lecture 14 Clipping and Scan Conversion Line Clipping Polygon Clipping Clipping in Three Dimensions Scan Conversion (Rasterization) [Angel 7.3-7.6, 7.8-7.9] March 19, 2002 Frank

More information

Basic Graphs of the Sine and Cosine Functions

Basic Graphs of the Sine and Cosine Functions Chapter 4: Graphs of the Circular Functions 1 TRIG-Fall 2011-Jordan Trigonometry, 9 th edition, Lial/Hornsby/Schneider, Pearson, 2009 Section 4.1 Graphs of the Sine and Cosine Functions Basic Graphs of

More information

Tokens, Expressions and Control Structures

Tokens, Expressions and Control Structures 3 Tokens, Expressions and Control Structures Tokens Keywords Identifiers Data types User-defined types Derived types Symbolic constants Declaration of variables Initialization Reference variables Type

More information

Linked lists. Yet another Abstract Data Type Provides another method for providing space-efficient storage of data

Linked lists. Yet another Abstract Data Type Provides another method for providing space-efficient storage of data Linked lists One of the classic "linear structures" What are linked lists? Yet another Abstract Data Type Provides another method for providing space-efficient storage of data What do they look like? Linked

More information

MM1_ doc Page E-1 of 12 Rüdiger Siol :21

MM1_ doc Page E-1 of 12 Rüdiger Siol :21 Contents E Structures, s and Dynamic Memory Allocation... E-2 E.1 C s Dynamic Memory Allocation Functions... E-2 E.1.1 A conceptual view of memory usage... E-2 E.1.2 malloc() and free()... E-2 E.1.3 Create

More information

Another class in the Form arsenal of Items is ChoiceGroup.

Another class in the Form arsenal of Items is ChoiceGroup. Another class in the Form arsenal of Items is ChoiceGroup. ChoiceGroup offers a list of choices, the user can choose one or more of these options according to the type of ChoiceGroup we will detect it

More information

Data Structures (CS301) LAB

Data Structures (CS301) LAB Data Structures (CS301) LAB Objectives The objectives of this LAB are, o Enabling students to implement Doubly Linked List practically using c++ and adding more functionality in it. Introduction to Singly

More information

using namespace System::Drawing::Drawing2D; using namespace System::Collections::Generic;

using namespace System::Drawing::Drawing2D; using namespace System::Collections::Generic; using namespace System::Drawing::Drawing2D; using namespace System::Collections::Generic; private: System::Void Form1_Load(System::Object^ System::EventArgs^ e) Text = "Grafika"; tabpage1->text = "2D";

More information

HOD: WISKUNDE-DIDAKTIEK 174

HOD: WISKUNDE-DIDAKTIEK 174 HOD: WISKUNDE-DIDAKTIEK 174 HUISWERK 3 DIE GRAFIESE SAKREKENAAR VENSTER Werk deur die tutoriaal... Handig slegs jou antwoorde vir ACTIVITIES, vrae 1-11 in. Illustreer met handsketse... 1 TUTORIAL: WHICH

More information

typedef unsigned char unch; char far *screen = (char far *) 0xA ; unch pal_buf[max_col][3]; int xmax, ymax;

typedef unsigned char unch; char far *screen = (char far *) 0xA ; unch pal_buf[max_col][3]; int xmax, ymax; #include #include #include #include #include #include #define MAX_COL 256 typedef unsigned char unch; char far *screen = (char far *) 0xA0000000;

More information

Pointers, Dynamic Data, and Reference Types

Pointers, Dynamic Data, and Reference Types Pointers, Dynamic Data, and Reference Types Review on Pointers Reference Variables Dynamic Memory Allocation The new operator The delete operator Dynamic Memory Allocation for Arrays 1 C++ Data Types simple

More information

6 Using Technology Wisely

6 Using Technology Wisely 6 Using Technology Wisely Concepts: Advantages and Disadvantages of Graphing Calculators How Do Calculators Sketch Graphs? When Do Calculators Produce Incorrect Graphs? The Greatest Integer Function Graphing

More information

COMP Summer 2015 (A01) Jim (James) Young jimyoung.ca

COMP Summer 2015 (A01) Jim (James) Young jimyoung.ca COMP 1010- Summer 2015 (A01) Jim (James) Young young@cs.umanitoba.ca jimyoung.ca Hello! James (Jim) Young young@cs.umanitoba.ca jimyoung.ca office hours T / Th: 17:00 18:00 EITC-E2-582 (or by appointment,

More information

CSCI 2212: Intermediate Programming / C Review, Chapters 10 and 11

CSCI 2212: Intermediate Programming / C Review, Chapters 10 and 11 ... 1/16 CSCI 2212: Intermediate Programming / C Review, Chapters 10 and 11 Alice E. Fischer February 3, 2016 ... 2/16 Outline Basic Types and Diagrams ... 3/16 Basic Types and Diagrams Types in C C has

More information

Lecture overview. Visualisatie BMT. Transparency. Transparency. Transparency. Transparency. Transparency Volume rendering Assignment

Lecture overview. Visualisatie BMT. Transparency. Transparency. Transparency. Transparency. Transparency Volume rendering Assignment Visualisatie BMT Lecture overview Assignment Arjan Kok a.j.f.kok@tue.nl 1 Makes it possible to see inside or behind objects Complement of transparency is opacity Opacity defined by alpha value with range

More information

Chapter. Implicit Function Graphs

Chapter. Implicit Function Graphs Chapter 14 Implicit Function Graphs You can graph any one of the following types of implicit functions using the calculator s built-in functions. Parabolic graph Circle graph Elliptical graph Hyperbolic

More information

Clipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling

Clipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling Clipping & Culling Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling Lecture 11 Spring 2015 What is Clipping? Clipping is a procedure for spatially partitioning geometric primitives,

More information

A foundation for programming. Classes and objects. Overview. Java primitive types. Primitive types Creating your own data types

A foundation for programming. Classes and objects. Overview. Java primitive types. Primitive types Creating your own data types Classes and objects A foundation for programming any program you might want to write objects functions and modules build even bigger programs and reuse code http://www.flickr.com/photos/vermegrigio/5923415248/

More information

Lesson 8 Practice Problems

Lesson 8 Practice Problems Name: Date: Lesson 8 Section 8.1: Characteristics of Quadratic Functions 1. For each of the following quadratic functions: Identify the coefficients a, b, c Determine if the parabola opens up or down and

More information

Graphing with a Graphing Calculator

Graphing with a Graphing Calculator APPENDIX C Graphing with a Graphing Calculator A graphing calculator is a powerful tool for graphing equations and functions. In this appendix we give general guidelines to follow and common pitfalls to

More information

(************************ Instructions de base ************************) #open "graphics";; open_graph " 800x ";; (* SORTIE : - : unit = () *)

(************************ Instructions de base ************************) #open graphics;; open_graph  800x ;; (* SORTIE : - : unit = () *) (**********************************************************************) (* Corrige du TD 4 *) (**********************************************************************) (************************ Instructions

More information