Math 7 Elementary Linear Algebra PLOTS and ROTATIONS

Similar documents
To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6

MAT 343 Laboratory 4 Plotting and computer animation in MATLAB

To graph the point (r, θ), simply go out r units along the initial ray, then rotate through the angle θ. The point (1, 5π 6. ) is graphed below:

Math 259 Winter Unit Test 1 Review Problems Set B

Math 231E, Lecture 34. Polar Coordinates and Polar Parametric Equations

Lab 2B Parametrizing Surfaces Math 2374 University of Minnesota Questions to:

Goals: Course Unit: Describing Moving Objects Different Ways of Representing Functions Vector-valued Functions, or Parametric Curves

Supplementary Material: The Rotation Matrix

Unit 2: Trigonometry. This lesson is not covered in your workbook. It is a review of trigonometry topics from previous courses.

Representing 2D Transformations as Matrices

Kinematics of the Stewart Platform (Reality Check 1: page 67)

Review of Trigonometry

PARAMETERIZATIONS OF PLANE CURVES

AQA GCSE Further Maths Topic Areas

SM 2. Date: Section: Objective: The Pythagorean Theorem: In a triangle, or

MATHEMATICS FOR ENGINEERING TUTORIAL 5 COORDINATE SYSTEMS

12 whereas if I terminate the expression with a semicolon, the printed output is suppressed.

Warm Up: please factor completely

1 Introduction to Matlab

2.0 Trigonometry Review Date: Pythagorean Theorem: where c is always the.

Study Guide for Test 2

Getting Started with MATLAB

Common Core Standards Addressed in this Resource

E0005E - Industrial Image Analysis

Kevin James. MTHSC 206 Section 15.6 Directional Derivatives and the Gra

Polar Coordinates

b 1. If he flips the b over to the left, what new letter is formed? Draw a picture to the right.

PreCalculus Unit 1: Unit Circle Trig Quiz Review (Day 9)

ARRAY VARIABLES (ROW VECTORS)

Graphing Polar equations.notebook January 10, 2014

3.0 Trigonometry Review

MATH EXAM 1 - SPRING 2018 SOLUTION

12.4 Rotations. Learning Objectives. Review Queue. Defining Rotations Rotations

Section 7.6 Graphs of the Sine and Cosine Functions

Lesson 27: Angles in Standard Position

6 Appendix B: Quick Guide to MATLAB R

Answers to practice questions for Midterm 1

Transformations. Write three rules based on what you figured out above: To reflect across the y-axis. (x,y) To reflect across y=x.

MAT 275 Laboratory 1 Introduction to MATLAB

CCNY Math Review Chapters 5 and 6: Trigonometric functions and graphs

Use Parametric notation. Interpret the effect that T has on the graph as motion.

is a plane curve and the equations are parametric equations for the curve, with parameter t.

Part I. There are 5 problems in Part I, each worth 5 points. No partial credit will be given, so be careful. Circle the correct answer.

+ b. From this we can derive the following equations:

Using Polar Coordinates. Graphing and converting polar and rectangular coordinates

Chapter 10: Parametric And Polar Curves; Conic Sections

Lesson 5.6: Angles in Standard Position

Introduction to MATLAB Practical 1

: Find the values of the six trigonometric functions for θ. Special Right Triangles:

Math (Spring 2009): Lecture 5 Planes. Parametric equations of curves and lines

Basic Graphs. Dmitry Adamskiy 16 November 2011

Chapter 10 Homework: Parametric Equations and Polar Coordinates

8-1 Simple Trigonometric Equations. Objective: To solve simple Trigonometric Equations and apply them

Trigonometric Functions of Any Angle

Math 210, Exam 2, Spring 2010 Problem 1 Solution

Reflections, Translations, and Dilations

Math 136 Exam 1 Practice Problems

Practice problems from old exams for math 233 William H. Meeks III December 21, 2009

Algebra II. Slide 1 / 162. Slide 2 / 162. Slide 3 / 162. Trigonometric Functions. Trig Functions

521493S Computer Graphics Exercise 2 Solution (Chapters 4-5)

Parametric Curves, Polar Plots and 2D Graphics

5.2. The Sine Function and the Cosine Function. Investigate A

Pre-Calc Unit 14: Polar Assignment Sheet April 27 th to May 7 th 2015

Math 462: Review questions

2D Object Definition (1/3)

Matrix Transformations The position of the corners of this triangle are described by the vectors: 0 1 ] 0 1 ] Transformation:

Math 144 Activity #7 Trigonometric Identities

Algebra II Trigonometric Functions

Trigonometric Ratios and Functions

Lesson 34 Solving Linear Trigonometric Equations

Practice with Parameterizing Curves and Surfaces. (Part 1)

Linear algebra deals with matrixes: two-dimensional arrays of values. Here s a matrix: [ x + 5y + 7z 9x + 3y + 11z

A lg e b ra II. Trig o n o m e tric F u n c tio

Translations SLIDE. Example: If you want to move a figure 5 units to the left and 3 units up we would say (x, y) (x-5, y+3).

18.02 Multivariable Calculus Fall 2007

Can be put into the matrix form of Ax=b in this way:

Circular Trigonometry Notes April 24/25

In a right triangle, the sum of the squares of the equals the square of the

Solution Notes. COMP 151: Terms Test

2D and 3D Transformations AUI Course Denbigh Starkey

SECTION 4.5: GRAPHS OF SINE AND COSINE FUNCTIONS

Logical Subscripting: This kind of subscripting can be done in one step by specifying the logical operation as the subscripting expression.

MATLAB. Input/Output. CS101 lec

Hello, welcome to the video lecture series on Digital Image Processing. So in today's lecture

Winter 2012 Math 255 Section 006. Problem Set 7

Math 113 Calculus III Final Exam Practice Problems Spring 2003

Physics 326G Winter Class 2. In this class you will learn how to define and work with arrays or vectors.

COMP 558 lecture 19 Nov. 17, 2010

Unit 4 Graphs of Trigonometric Functions - Classwork

Calculus III. Math 233 Spring In-term exam April 11th. Suggested solutions

Programming in Mathematics. Mili I. Shah

Lecture 34: Curves defined by Parametric equations

Lesson 10.1 TRIG RATIOS AND COMPLEMENTARY ANGLES PAGE 231

INTRODUCTION TO MATLAB PLOTTING WITH MATLAB

Functions and Transformations

Math 144 Activity #2 Right Triangle Trig and the Unit Circle

3D Computer Graphics. Jared Kirschner. November 8, 2010

Differential Geometry: Circle Patterns (Part 1) [Discrete Conformal Mappinngs via Circle Patterns. Kharevych, Springborn and Schröder]

Ch. 2 Trigonometry Notes

Ch. 7.4, 7.6, 7.7: Complex Numbers, Polar Coordinates, ParametricFall equations / 17

Transcription:

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 the basic plot command requires two inputs: a vector of x values and a vector of y values. To plot the line segment connecting the point P 1 ( 0,0 ) to the point P 2 (,1) observe that the x values will change from x = 0 to x = and the y values will change from y = 0 to y = 1. To plot the line segment, store the x and y values in row vectors and then plot: >> x = [0 ] >> y = [0 1] Let s plot something slightly more interesting. Example 2: We re going to construct a triangular figure by plotting the line segments that connect the three points ( 0,0 ), (,1 ), and ( 2, ). One way to do this is by constructing the plotting vectors for each line segment and then plotting them all together: >> x 1 = [0 ] >> x 2 = [ 2] >> x = [2 0] >> y 1 = [0 1] >> y 2 = [1 ] >> y = [ 0] >> plot( x1, y1, x2, y2, x, y ) In the plot command above the pairing x1, y 1 constructs the line segment from ( 0, 0 ) to (,1 ); the pairing 2, 2 and the pairing, x y constructs the line segment from ( ) ( ) x y constructs the line segment from ( 2, ) to ( 0,0 ).,1 to 2, ; A more efficient way to plot the triangle, however, is to store the coordinate date in a pair of row vectors. If we think of moving along the sides of the triangle from 2,, and then returning the point ( 0,0 ) to the point (,1 ), from there to the point ( )

Plots and Rotations page 2 to the origin, we see that the x values change from 0 to to 2 to 0. We store that information in a row vector: >> x = [0 2 0] We can store the information about the y values in the same way: >> y = [0 1 0] then plot ROTATION OF PLOTS the angle θ. If the ordered pair ( ) cosθ sinθ The matrix P = sinθ cosθ can be used to rotate a figure in the plane through x, y gives the coordinates of a point in the xy- x cosθ sinθ x plane, then the multiplication P y = sinθ cosθ y will produce the coordinates of the rotated point. Example : To see how this works, we will rotate the triangle plotted above π through the angle. 6 First define the rotation matrix P: >> P= [cos( pi/ 6) sin( pi/ 6) ; sin( pi/ 6) cos( pi/ 6)] Next, multiply P times a matrix whose rows are the x and y row vectors entered previously. >> R = P*[ x; y] Row 1 of the resulting matrix R contains the x -coordinates of the rotated points, while row 2 contains the y -coordinates of the rotated points. To plot the rotated figure, we need to define rotated x and y row vectors. We can use a MatLab command to do this: >> xr = R(1,:) >> yr = R(2,:)

Plots and Rotations page Now, we will plot the original triangle and the rotated triangle (in red): >> plot( xr, yr,' r ') Example 4: In this example we will construct a figure and then rotate it. Here is a plot of the figure 6 5 4 2 1 0-1 -1 0 1 2 4 5 The line segments that make up the figure are defined by the points ( 0,0 ), ( 2,0 ), (,0 ), (, 2 ), ( 2, 2 ), ( 4,0 ), ( 4, ), ( 2,5 ), and ( 0, ) To draw the house, construct line segments by starting at the origin and moving counterclockwise around the frame of the house, with a side-trip around the doorway. Enter the following x and y row vectors and plot command to draw the house. >> x = [0,2,,,2,2,,4,4,2,0,0] >> y = [0,0,0,2,2,0,0,0,,5,,0]

Plots and Rotations page 4 You will notice that MatLab draws the graph so that it fills the plot frame. To change the size of the viewing window, use the axis command. The syntax for this command is Enter the command >> axis([ -1 5-1 6 ]) to obtain the view shown above. axis([xmin xmax ymin ymax]) Example 5: Now, let s rotate the house through the angle 2 π. Using the method shown in Example, define a rotation matrix P and create a matrix of rotated points by multiplying P times a matrix whose rows are the row vectors used to graph the house. From this matrix, extrapolate the rotated x and y row vectors and plot them. >> P = [cos(2*pi/) -sin(2*pi/); sin(2*pi/) cos(2*pi/)] (This defines the rotation matrix) >> R = P*[x;y]; (This defines the matrix of rotated points) >> xr = R(1,:); yr = R(2,:); (This defines the row vectors for plotting) (turns on the grid) (holds the grid plot) >> plot(x,y,xr,yr,'r') (plots the original house and the rotated house) >> axis([-6.5 5-6]) (enlarges the viewing window) Example 6: We are not limited to plotting and rotating figures defined by leg segments. In this example, we will plot and then rotate an ellipse. Recall the general form of the equation of an ellipse centered at ( hk, ) is given by the equation ( x h) ( y k) + = 1 a b where the major axis is determined by the relative sizes of a and b. Since the graph of an ellipse is not the graph of a function, we use a parameterization to graph the ellipse in MatLab. The parameterization makes use of the trigonometric identity cos θ sin θ 1 + =. 2 x 2 x To graph the ellipse + y = 1, we let = cost and y = sin t. Then x = cost, 9 y = sin t, 0 t 2π is a parameterization of the curve. Enter the following lines to graph the ellipse. Be sure you suppress output by ending input with a semicolon.

Plots and Rotations page 5 >> t = [0 : 0.001 : 2*pi]; >> x = *cos(t) ; y = sin(t); >> plot(x,y) >> axis([-.5.5-1.5 1.5]) >> P = [cos(pi/4) -sin(pi/4) ; sin(pi/4) cos(pi/4)] >> R = P*[x;y]; >> xr = R(1,:) ; yr = R(2,:); >> plot(x,y,xr,yr) Example 7: Any parameterized curve can be rotated by the method shown above. Enter the following lines to see an example. First, the curve: >> t = [ -2*pi : 0.01 : 2*pi ]; >> x = t + sin(2*t) ; y = t + sin(*t); >> plot(x,y) Now the rotation of the curve through the angle 2 π : >> P = [ cos(pi/2) -sin(pi/2) ; sin(pi/2) cos(pi/2) ] >> R = P*[x;y] ; >> xr = R(1,:); yr = R(2,:); >> plot(x,y,xr,yr)