Intro Vectors 2D implicit curves 2D parametric curves. Graphics 2011/2012, 4th quarter. Lecture 2: vectors, curves, and surfaces

Similar documents
Intro Vectors 2D implicit curves 2D parametric curves. Graphics 2012/2013, 4th quarter. Lecture 2: vectors, curves, and surfaces

Vectors Coordinate frames 2D implicit curves 2D parametric curves. Graphics 2008/2009, period 1. Lecture 2: vectors, curves, and surfaces

Elementary maths for GMT

Basic Surveying Week 3, Lesson 2 Semester 2017/18/2 Vectors, equation of line, circle, ellipse

Review of Coordinate Systems

Euclidean Spaces. Euclidean Spaces. Chapter 10 -S&B

Three-Dimensional Coordinate Systems. Three-Dimensional Coordinate Systems. Three-Dimensional Coordinate Systems. Three-Dimensional Coordinate Systems

Chapter 13: Vectors and the Geometry of Space

Chapter 13: Vectors and the Geometry of Space

Study guide for Exam 1. by William H. Meeks III October 26, 2012

1. Vectors.

Computer Graphics MTAT Raimond Tunnel

I&C 6N. Computational Linear Algebra

CG Basics 1 of 10. Mathematical Foundations: Vectors, Matrices, & Parametric Equations

1.1 Single Variable Calculus versus Multivariable Calculus Rectangular Coordinate Systems... 4

Vectors. 1 Basic Definitions. Liming Pang

MAT1035 Analytic Geometry

This pre-publication material is for review purposes only. Any typographical or technical errors will be corrected prior to publication.

Linear Algebra Homework and Study Guide

Vectors a vector is a quantity that has both a magnitude (size) and a direction

Course Notes Math 275 Boise State University. Shari Ultman

Linear Algebra I. Ronald van Luijk, 2015

Introduction. Chapter Points, Vectors and Coordinate Systems

Math 302 Outcome Statements Winter 2013

The Geometry of R n. Supplemental Lecture Notes for Linear Algebra Courses at Georgia Tech

Dot Products. K. Behrend. April 3, Abstract A short review of some basic facts on the dot product. Projections. The spectral theorem.

Algebra I Calculator Activities

Lecture 1: Systems of linear equations and their solutions

MTAEA Vectors in Euclidean Spaces

MAT 1339-S14 Class 8

Rigid Geometric Transformations

Linear Algebra Massoud Malek

GEOMETRY AND VECTORS

CHAPTER ONE FUNCTIONS AND GRAPHS. In everyday life, many quantities depend on one or more changing variables eg:

Exercises for Multivariable Differential Calculus XM521

12.5 Equations of Lines and Planes

VECTORS AND THE GEOMETRY OF SPACE

The Cross Product of Two Vectors

Vectors. The standard geometric definition of vector is as something which has direction and magnitude but not position.

Distance Formula in 3-D Given any two points P 1 (x 1, y 1, z 1 ) and P 2 (x 2, y 2, z 2 ) the distance between them is ( ) ( ) ( )

Department of Physics, Korea University

Math 241, Exam 1 Information.

Rigid Geometric Transformations

LINEAR ALGEBRA - CHAPTER 1: VECTORS

Vector equations of lines in the plane and 3-space (uses vector addition & scalar multiplication).

Vectors and Fields. Vectors versus scalars

MATH 255 Applied Honors Calculus III Winter Midterm 1 Review Solutions

Mathematics for Graphics and Vision

Midterm 1 Review. Distance = (x 1 x 0 ) 2 + (y 1 y 0 ) 2.

Milford Public Schools Curriculum. Department: Mathematics Course Name: Precalculus Level 1

Linear Algebra & Geometry why is linear algebra useful in computer vision?

Vectors Part 1: Two Dimensions

College Prep Algebra III Course #340. Course of Study. Findlay City School

Linear Algebra and Dirac Notation, Pt. 1

Math 32A Discussion Session Week 2 Notes October 10 and 12, 2017

Review of Vector Analysis in Cartesian Coordinates

Culminating Review for Vectors

Definitions and Properties of R N

Linear Algebra: Homework 3

VECTORS. Given two vectors! and! we can express the law of vector addition geometrically. + = Fig. 1 Geometrical definition of vector addition

Vectors and Plane Geometry

SOLUTIONS FOR PROBLEMS 1-30

MTH 464: Computational Linear Algebra

Linear Algebra MATH20F Midterm 1

(1) Recap of Differential Calculus and Integral Calculus (2) Preview of Calculus in three dimensional space (3) Tools for Calculus 3

Review of Linear Algebra

7.1 Projections and Components

Introduction to Vectors

Name: Lab Partner: Section: In this experiment vector addition, resolution of vectors into components, force, and equilibrium will be explored.

Vector Geometry. Chapter 5

MAT 1339-S14 Class 10 & 11

Solution. The relationship between cartesian coordinates (x, y) and polar coordinates (r, θ) is given by. (x, y) = (r cos θ, r sin θ).

4.1 Distance and Length

Unit 2: Lines and Planes in 3 Space. Linear Combinations of Vectors

DATE: MATH ANALYSIS 2 CHAPTER 12: VECTORS & DETERMINANTS

Study Guide for Benchmark #1 Window of Opportunity: March 4-11

Vectors and Matrices Lecture 2

Real Analysis III. (MAT312β) Department of Mathematics University of Ruhuna. A.W.L. Pubudu Thilan

SECTION 6.3: VECTORS IN THE PLANE

,, rectilinear,, spherical,, cylindrical. (6.1)

n=0 ( 1)n /(n + 1) converges, but not

Lecture 1 Complex Numbers. 1 The field of complex numbers. 1.1 Arithmetic operations. 1.2 Field structure of C. MATH-GA Complex Variables

Tennessee s State Mathematics Standards Precalculus

Vectors. September 2, 2015

Chapter 2: Vector Geometry

v = v 1 2 +v 2 2. Two successive applications of this idea give the length of the vector v R 3 :

Calculus Vector Principia Mathematica. Lynne Ryan Associate Professor Mathematics Blue Ridge Community College

Brief Review of Exam Topics

Exam 1 Review SOLUTIONS

Mathematics High School Functions

Analytic Geometry MAT 1035

Applied Linear Algebra in Geoscience Using MATLAB

Linear Algebra & Geometry why is linear algebra useful in computer vision?

Graphics (INFOGR), , Block IV, lecture 1 Deb Panja. Today: Vectors, and vector algebra in 2D. Welcome

FLORIDA STANDARDS TO BOOK CORRELATION FOR GRADE 7 ADVANCED

Mathematical Foundations: Intro

PreCalculus Honors Curriculum Pacing Guide First Half of Semester

Math (P)Review Part II:

Math 1 Unit 1 EOC Review

Mathematics 2203, Test 1 - Solutions

Transcription:

Lecture 2, curves, and surfaces

Organizational remarks Tutorials: Tutorial 1 will be online later today TA sessions for questions start next week Practicals: Exams: Make sure to find a team partner very soon Make sure to start working on the assignment very soon Make sure to contact me about exceptions, etc. very soon Dates will change Check website for exact data Inform us about conflicts as soon as possible

Recap: From 3D to 2D... Computer graphics: Modelling (creating 3d virtual worlds) Rendering (creating shaded 2d images from 3d models) Two basic methods: Ray tracing Projective methods The graphics pipeline: A sequence of operations transforming 3D models into pixels on the screen

From 2D geometry to pixels... In graphics, we usually deal with raster displays (not covered here; read chapter 3 if you want to know more). Raster displays = rectangular arrays of pixels Pixels (short for picture element ) = the smallest unit on the screen Single dots that make up the final image Remember: going from 2D geometry to fragments/pixels is called rasterization.

Screen coordinates (2D) How do we describe pixels on the screen? Usually pixels are usally indexed by their column i and row j with respect to a reference called the origin where i = 0 and j = 0. Be careful: in actual calculations, we sometimes deal with the pixel center (i.e. i + 0.5, j + 0.5 instead of i, j).

Screen coordinates (2D) Calculating the concrete coordinates of the center of pixel[i, j] from the abstract 2D geometry is easy, if we know The resolution n x n y of the image The x- and y-coordinates of the corners of the projection rectangle The order of the pixel rows (up or down)

Coordinates & coordinate systems Pixel coordinates give us a way to describe all points on the 2D screen. If we extend our screen to an infinite size, we can describe all points in a 2D space. If we add a third dimension, we can describe all points in a 3D space.

Coordinates & coordinate systems In graphics, such a system to describe n-dimensional spaces is often called a coordinate system. The required reference point (0, 0,..., 0) is called the origin. (More on coordinate systems later... )

Coordinates & coordinate systems We can not only use this to address the single pixels on the 2D screen, but also to describe our 3D world! We do this by using the mathematical concept of vectors (or vector spaces).

: definition Intro In R d a vector can be defined as an ordered d-tuple: v 1 v 2 v =. v d Alternatively, we can define a vector by its length and direction. v ( ) 5 v = 1

Points vs. vectors Intro 3D vectors and points (or locations) in 3D can both be represented with 3-tuples (x, y, z) but they are not the same! We can calculate with vectors (e.g. add them) We can add vectors to locations (resulting in new locations) But we can t add locations

: notations Intro In R 3, for example: v 1 v x x v v = v 2 or v y or y v v 3 v z z v or (v 1, v 2, v 3 ) or (v 1 v 2 v 3 ) T or... Note: there are also different symbols used for vectors, e.g. v, v, v,... v ( ) 5 v = 1

: algebraic interpretation A 2D vector (x v, y v ) can be seen as the point (x v, y v ) in the Cartesian plane. v ( ) 5 v = 1

: geometric interpretation A 2D vector (x v, y v ) can be seen as an offset from the origin. Such an offset (arrow) can be translated. v v v v = ( ) 5 1

of vectors Intro Given two vectors in R d, v = (v 1, v 2,..., v d ) and w = (w 1, w 2,..., w d ) their sum is defined as v + w = (v 1 + w 1, v 2 + w 2,..., v d + w d )

of vectors Intro of vectors is commutative, as can be seen easily from the geometric interpretation. Q: show algebraically that vector addition is commutative.

: length Intro The Euclidean length of a d-dimensional vector v is v = v1 2 + v2 2 + + v2 d v ( ) 5 v = 1

Null vector and unit vectors A vector 0 is the null vector if 0 = 0. A vector v is a unit vector if v = 1. Normalization: Given an arbitrary vector v, we can find a unit vector parallel to v by v unit = v v Q: Can every vector be normalized?

: scalar multiple A scalar multiple of a d-dimensional vector v is λ v = (λv 1, λv 2,..., λv d ) Note that v and λ v have either the same direction or opposite directions

Subtraction of vectors Intro Given two vectors in R d, v = (v 1, v 2,..., v d ) and w = (w 1, w 2,..., w d ) subtraction is defined as v w = (v 1 w 1, v 2 w 2,..., v d w d )

Parallel vectors Intro Two vectors v and w are parallel if one is a scalar multiple of the other, i.e., there is a λ such that v = λ w. Note that if one of the vectors is the null vector, then the vectors are considered neither parallel nor not parallel.

Bases Intro A 2D vector can be expressed as a combination of any pair of non-parallel vectors, i.e. a = λ 1 v + λ 2 w For instance, in the image, a = 1.5 v + 0.6 w. Such a pair is called linearly independent, and they form a 2D basis. v w a The extension to higher dimensions is straightforward.

Orthonormal basis Intro Two vectors form an orthonormal basis if (1) they are orthogonal to each other, and (2) they are unit vectors. The advantage of an orthonormal basis is that lengths of vectors, expressed in the basis, are easy to calculate.

Left- and right-handed systems Coordinate systems in 3D come in two flavors: left-handed and right-handed. There are arguments for both left- and right-handed systems for The global system The camera system Object systems Z X Y Y Y Z X X Z Camera coordinate system Z Y Y X X Z World coordinate system

Coordinate transformations A frequent operation in graphics is the change from one coordinate system (e.g., the (u, v, w) camera system) to another (e.g., the (x, y, z) global system). v u w Having orthonormal bases for both systems makes the transformations simpler. Z Y X

Dot product (inner product, scalar product) For two vectors v, w R d, the dot product (or inner product or scalar product) is defined as v w = v 1 w 1 +v 2 w 2 + +v d w d, dot product or v w = d i=1 v iw i 42 666 3.1415927

Dot product (inner product, scalar product) v w v w, We have that cos θ = where θ is the angle between the two vectors. dot product 42 666 3.1415927

Dot product (inner product, scalar product) Q: what is the inner product of an arbitrary unit vector with itself? Q: what do we know if for two vectors v and w we have that v w = 0? dot product 42 666 3.1415927

Dot product (inner product, scalar product) Another use: Calculate the length of the projection of one vector onto another. dot product 42 666 3.1415927

Cross product Intro For two vectors v, w R 3, the cross product is defined as v 2 w 3 v 3 w 2 v w = v 3 w 1 v 1 w 3 v 1 w 2 v 2 w 1 cross product We have that v w = v w sin θ, where θ is the angle between v and w.

Cross product Intro Q: show that v w is orthogonal to both v and w. Proof: (Remember the scalar product and cos 90 = 0) (a) v is perpendicular to v w v ( v w) = (v 1, v 2, v 3) (v 2w 3 v 3w 2, v 3w 1 v 1w 3, v 1w 2 v 2w 1) = (v 1v 2w 3 v 1v 3w 2 + v 2v 3w 1 v 2v 1w 3 + v 3v 1w 2 v 3v 2w 1) = 0 (b) w is perpendicular to v w Exercise cross product

Cross product Intro Special case: v and w are orthogonal unit vectors

Cross product Intro Q: what is v v? Q: what is v w if v and w are parallel? cross product

Cross product Intro Q: what is v v? The nullvector. Proof for the 1st coordinate: v 2v 3 v 3v 2 = 0 Other coordinates: exercise! Q: what is v w if v and w are parallel? Again, the nullvector. Parallel: w = λ v Proof for the 1st coordinate: λv 2v 3 v 3λv 2 = 0 Other coordinates: exercise! cross product

Cross product Intro Alternatively, remember that v w = v w sin θ Q: what is v v? θ = 0, so sin θ = 0 Hence, it must be the nullvector. cross product Q: what is v w if v and w are parallel? θ = 0, so sin θ = 0 Hence, it must be the nullvector.

Basic geometric entities (2D) Introduction General curves Circles Lines Normal vectors (and the related arithmetic) provide us with a powerful tool to create complex 3D graphics (and manipulate it). Let s look at some basic geometric shapes: lines and circles in 2D (3D later) There are different ways to represent such basic geometric entities, e.g.: implicit parametric v w a

2D Implicit curves Intro Introduction General curves Circles Lines Normal vectors An implicit curve in 2D has the form f(x, y) = 0 f maps two-dimensional points to a real value, i.e. (x, y) f(x, y) The points for which this value is 0 are on the curve, while other points are not on the curve.

Implicit representation of circles Introduction General curves Circles Lines Normal vectors The implicit representation of a 2D circle with radius r around the origin is x 2 + y 2 r 2 = 0 Why? If p = (x, y) is a vector pointing to a random point on the circle, it s length must be the circle s radius r, so p = r. x2 + y 2 = r x 2 + y 2 = r 2 x 2 + y 2 r 2 = 0 Note: alternatively, we could look at the related triangle and use Pythagoras.

Implicit representation of circles Introduction General curves Circles Lines Normal vectors The implicit representation of a 2D circle with center c and radius r is (x x c ) 2 + (y y c ) 2 r 2 = 0 Again, why?

Implicit representation of lines Introduction General curves Circles Lines Normal vectors A well-known representation of lines is the slope-intercept form y = ax + c This can easily be converted to ax + y c = 0 which is the implicit representation of a line, or in its general form: Ax + By + C = 0

Implicit representation of lines Introduction General curves Circles Lines Normal vectors If c = 0, the line intersects the origin, and we can represent the implicit representation using vectors, i.e. with p = n p = 0 ( ) x and n = y ( ) a 1

Implicit representation of lines Introduction General curves Circles Lines Normal vectors If the line does not intersect with the origin, we have with p = n ( p p 0 ) = 0 ( ) x, n = y ( ) a, p 1 0 = p 0 is a vector to a point on the line. ( p0x p 0y )

Implicit representation of lines Introduction General curves Circles Lines Normal vectors The vector notation is important, because the vector n = ( a, 1) is perpendicular to the line. (This is true for the first 2 coefficiants of any implicit line representation.) How can we prove that?

Implicit representation of lines Introduction General curves Circles Lines Normal vectors Proof: Assume the implicit representation f( p) = Ax + By + C = 0 of a line and two random points p 1 = (x 1, y 1), p 2 = (x 2, y 2) on this line. Then the vector p 2 p 1 must be on the line. We know that n = (n x, n y) is perpendicular to the line if and only if n ( p 2 p 1) = 0. n ( p 2 p 1) = n x(x 2 x 1) + n y(y 2 y 1) = n xx 2 n xx 1 + n yy 2 n yy 1 + C C = f( p 2) f( p 1) = 0

Normal vectors Intro Introduction General curves Circles Lines Normal vectors that are prependicular to another vector or line, are called normal vectors. Or, more general, if a vector is perpendicular to the tangent plane of a surface at a particular point p on that surface, we call it the surface normal (or just normal) to that surface at p.

General curves Lines Circles A parametric curve is controlled by a single parameter, and has the form ( ) x = y ( ) g(t) h(t) Parametric representations have some advantages over functions, even if a function would suffice to represent the curve. h(t) g(t)

General curves Lines Circles Parametric equation of a line The parametric equation of a line through the points p 0 and p 1 is p(t) = p 0 + t( p 1 p 0 ). with t R. We often call p 0 support vector and p 1 p 0 direction vector. (Or sometimes position and displacement vectors.) p 0 p 1

Parametric equation of a line General curves Lines Circles Alternatively, p(t) = p 0 + t( p 1 p 0 ). p can be written as 1 ( ) ( ) p 0 x xp0 + t(x = p1 x p0 ) y y p0 + t(y p1 y p0 )

General curves Lines Circles Conversion between representations Sometimes it is convenient to be able to convert from one representation into another. Q: how do we do that? p 0 p 1

General curves Lines Circles Conversion between representations Slope-intercept repr.: y = ax + b Implicit representation: f(x, y) = ax + y c = 0 or in its general form: f(x, y) = Ax + By + C = 0 p 0 p 1 Parametric representation (vector form): p(t) = p 0 + t( p 1 p 0 )

Parametric equation of a circle General curves Lines Circles The parametric equation of a 2D circle with center c and radius r is ( ) x y = ( ) xc + r cos φ y c + r sin φ p φ c