Vector and Matrix Algebra

Slides:



Advertisements
Similar presentations
Fun with Vectors. Definition A vector is a quantity that has both magnitude and direction Examples?
Advertisements

Vector Calculus Mengxia Zhu Fall Objective Review vector arithmetic Distinguish points and vectors Relate geometric concepts to their algebraic.
1 3D Vector & Matrix Chapter 2. 2 Vector Definition: Vector is a line segment that has the direction. The length of the line segment is called the magnitude.
Math Review Guest Lecturer: Michiel van de Panne Week 1, Wed Jan 9
Maths for Computer Graphics
Chapter 4.1 Mathematical Concepts
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry Trigonometric functions Defined using right triangle  x y h.
CSCE 590E Spring 2007 Basic Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Basic Math Vectors and Scalars Addition/Subtraction of Vectors Unit Vectors Dot Product.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Math Review Week 1, Wed.
Chapter 2: Vectors Ian Parberry University of North Texas Fletcher Dunn Valve Software 3D Math Primer for Graphics and Game Development.
Vectors.
Vectors and Matrices Class 17.1 E: Ch. 5.
Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 2: Review of Basic Math
Computer Vision Group Prof. Daniel Cremers Autonomous Navigation for Flying Robots Lecture 2.1: Recap on Linear Algebra Daniel Cremers Technische Universität.
Graphics CSE 581 – Interactive Computer Graphics Mathematics for Computer Graphics CSE 581 – Roger Crawfis (slides developed from Korea University slides)
Sundermeyer MAR 550 Spring Laboratory in Oceanography: Data and Methods MAR550, Spring 2013 Miles A. Sundermeyer Linear Algebra & Calculus Review.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
Patrick Nichols Thursday, September 18, Linear Algebra Review.
Chapter 4.1 Mathematical Concepts
3-2 Vectors and Scalars  Is a number with units. It can be positive or negative. Example: distance, mass, speed, Temperature… Chapter 3 Vectors  Scalar.
Section 13.4 The Cross Product. Torque Torque is a measure of how much a force acting on an object causes that object to rotate –The object rotates around.
CSCE 552 Spring 2011 Math By Jijun Tang. Layered.
6.837 Linear Algebra Review Patrick Nichols Thursday, September 18, 2003.
Shivkumar Kalyanaraman Rensselaer Polytechnic Institute 1 : “shiv rpi” Linear Algebra A gentle introduction Linear Algebra has become as basic and as applicable.
6.837 Linear Algebra Review Rob Jagnow Monday, September 20, 2004.
Introduction to Vectors (Geometric)
Linear Algebra 1.Basic concepts 2.Matrix operations.
1 Graphics CSCI 343, Fall 2015 Lecture 10 Coordinate Transformations.
Chun-Yuan Lin Mathematics for Computer Graphics 2015/12/15 1 CG.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Math Review.
EGR 115 Introduction to Computing for Engineers MATLAB Basics 5: Applications – Vector Math Friday 12 Sept 2014 EGR 115 Introduction to Computing for Engineers.
Vectors.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Math Basics Week 1, Fri.
Matrix Operations.
CSCE 552 Fall 2012 Math By Jijun Tang. Applied Trigonometry Trigonometric functions  Defined using right triangle  x y h.
Vectors and Dot Product 6.4 JMerrill, Quick Review of Vectors: Definitions Vectors are quantities that are described by direction and magnitude.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Math Review Week 1, Fri.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Vectors and Vector Addition. Vectors vs. Scalars Scalars are physical quantities having only magnitude– that is, a numerical value & units. Ex: a speed.
Chapter 4.1 Mathematical Concepts. 2 Applied Trigonometry "Old Henry And His Old Aunt" Defined using right triangle  x y h.
Coordinatate systems are used to assign numeric values to locations with respect to a particular frame of reference commonly referred to as the origin.
12 A VECTORS AND SCALARS 12 B GEOMETRIC OPERATIONS HOMEWORK: VIEW POWER POINT BEFORE NEXT CLASS.
Math /7.5 – Vectors 1. Suppose a car is heading NE (northeast) at 60 mph. We can use a vector to help draw a picture (see right). 2.
VECTORS and SCALARS part 2 Give me some DIRECTION!!!
Vectors Def. A vector is a quantity that has both magnitude and direction. v is displacement vector from A to B A is the initial point, B is the terminal.
MTH108 Business Math I Lecture 20.
Spaces.
CSE 167 [Win 17], Lecture 2: Review of Basic Math Ravi Ramamoorthi
Math Fundamentals Maths revisit.
Mathematics for Computer Graphics
Elementary Linear Algebra
2 Vectors In 2-space And 3-space
Scalar & Vector Quantities
ECE 383/ME 442: Intro to Robotics and Automation
Chapter 3 Vectors.
2. Matrix Algebra 2.1 Matrix Operations.
Distance vs. Displacement
Lecture 2: Geometry vs Linear Algebra Points-Vectors and Distance-Norm
Vectors.
Ch. 15- Vectors in 2-D.
2 Vectors in 2-space and 3-space
Linear Algebra A gentle introduction
Math review - scalars, vectors, and matrices
Game Programming Algorithms and Techniques
Journal Entry 7 Vector Analysis
Serway and Jewett Chapter 3
Presentation transcript:

Vector and Matrix Algebra Jung Lee

Vector Algebra

Scalar vs. Vector Scalar Vector Concept of magnitude Size, length, … Vector Scalar + direction

Vector-valued Quantities Force Direction + strength Displacement Direction + distance of moving object … Velocities Direction + speed

Vectors for Pure Direction Direction the player is looking in a 3D game Direction a polygon is facing Direction in which a ray of light travels

Drawing Vectors Head Tail

Point and Vector Point (x, y, z) Vector (x, y, z) A location in 3D space Vector (x, y, z) Direction + magnitude Not fixed at specific location Point can be represented as a vector

Left-handed vs. Right-handed Left-handed Coordinate System Direct3D Right-handed Coordinate System OpenGL Math textbooks [Left-handed] [Right-handed]

Basic Vector Operations Equality Addition/Subtraction Scalar Multiplication

Geometric Interpretations Scalar Multiplication Addition Subtraction

Vector Length/Norm/Magnitude [Pythagorean Formula]

Unit Vector Unit Vector Normalization Having length 1 Making unit vector

Dot (Inner/Scalar) Product Dot Product of Two Vectors Result : scalar value Thus, dot product is called scalar product - + - +

Cross (Outer/Vector) Product Cross Product of Two Vectors w is orthogonal to u and v Result : vector Thus, cross product is called vector product

Cross Product Example A(1, 0, 0), B(0, 1, 0) C=AxB=(0x0-0x1, 0x0-1x0, 1x1-0x0)=(0, 0, 1) A, B, and C are the base axes in right-handed coordinate system

Vector in Practice class VECTOR { public: float Magnitude(); float InnerProduct(VECTOR v); VECTOR CrossProduct(VECTOR v); float x; float y; float z; }; float VECTOR::Magnitude() { return sqrt(x * x + y * y + z * z); } float VECTOR::InnerProduct(VECTOR v) return (x * v.x + y * v.y + z * v.z); VECTOR VECTOR::CrossProduct(VECTOR v) VECTOR result; result.x = y * v.z - z * v.y; result.y = z * v.x - x * v.z; result.z = x * v.y - y * v.x; return result;

Matrix Algebra

Matrix Examples Matrix A : Dimension 4x4 Matrix B : Dimension 3x2 Square matrix Matrix B : Dimension 3x2 Matrix u : Row vector Matrix v : Column vector

Basic Matrix Operations Equality Addition/Subtraction Scalar Multiplication

Matrix Multiplications Associativity

Various Matrices Transpose of MxN Matrix : NxM Matrix Identity Matrix

Matrix in Practice class MATRIX { public: MATRIX Add(MATRIX m); MATRIX Subtract(MATRIX m); MATRIX Multiply(MATRIX m); MATRIX Transpose(); float ele[4][4]; float num_of_rows; float num_of_columns; }; MATRIX MATRIX::Add(MATRIX m) MATRIX result; for(int i = 0; i < num_of_rows; i++) for(int j = 0; j < num_of_columns; j++) result.ele[i][j] = ele[i][j] + m.ele[i][j]; return result; } MATRIX MATRIX::Multiply(MATRIX m) { int i, j, k; MATRIX result; for(i = 0; i < num_of_rows; i++) for(j = 0; j < num_of_columns; j++) result.ele[i][j] = 0.0; if(num_of_columns == m.num_of_rows) result.num_of_rows = num_of_rows; result.num_of_columns = m. num_of_columns; for(j = 0; j < m.num_of_columns; j++) for(k = 0; k < num_of_columns; k++) result.ele[i][j] += ele[i][k] * m.ele[k][j]; } return result;