Chapter 2. Geometrical Methods

Slides:



Advertisements
Similar presentations
Vectors, Points, Lines and Planes Jim Van Verth Lars M. Bishop
Advertisements

Chapter 4 Euclidean Vector Spaces
Chapter 10 Vocabulary.
8.2 Kernel And Range.
3D Geometry for Computer Graphics
CS 691 Computational Photography Instructor: Gianfranco Doretto Image Warping.
CS B659: Principles of Intelligent Robot Motion Rigid Transformations.
Chapter 7: Vectors and the Geometry of Space
Chapter 2. Geometrical Methods - Quaternions -  전자공학 / Networked Virtual Computing Lab/ 조성업.
Computer Graphics Recitation 5.
Computer Graphics Recitation 2. 2 The plan today Learn about rotations in 2D and 3D. Representing rotations by quaternions.
Image Warping : Computational Photography Alexei Efros, CMU, Fall 2008 Some slides from Steve Seitz
Matrices and Systems of Equations
Computer Graphics CSC 630 Lecture 2- Linear Algebra.
Orthogonality and Least Squares
CS I400/B659: Intelligent Robotics Rigid Transformations.
2IV60 Computer graphics set 4:3D transformations and hierarchical modeling Jack van Wijk TU/e.
2IV60 Computer Graphics Basic Math for CG
Basics of Linear Algebra A review?. Matrix  Mathematical term essentially corresponding to an array  An arrangement of numbers into rows and columns.
Point set alignment Closed-form solution of absolute orientation using unit quaternions Berthold K. P. Horn Department of Electrical Engineering, University.
COS 397 Computer Graphics Svetla Boytcheva AUBG, Spring 2013.
1 February 24 Matrices 3.2 Matrices; Row reduction Standard form of a set of linear equations: Chapter 3 Linear Algebra Matrix of coefficients: Augmented.
Mathematical Topics Review of some concepts:  trigonometry  aliasing  coordinate systems  homogeneous coordinates  matrices, quaternions.
Vectors & Matrices Marq Singer
Chapter 5: The Orthogonality and Least Squares
1.1 – 1.2 The Geometry and Algebra of Vectors.  Quantities that have magnitude but not direction are called scalars. Ex: Area, volume, temperature, time,
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.
Computer Graphics Bing-Yu Chen National Taiwan University.
Elementary Linear Algebra Anton & Rorres, 9th Edition
Intro to 3D Models Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Review of Matrices Or A Fast Introduction.
CSE 681 Review: Transformations. CSE 681 Transformations Modeling transformations build complex models by positioning (transforming) simple components.
1 MAC 2103 Module 6 Euclidean Vector Spaces I. 2 Rev.F09 Learning Objectives Upon completing this module, you should be able to: 1. Use vector notation.
Vector Addition Cummutative Law A B C B A C A + B = C B + A = C A + B = B + A.
10.4 Matrix Algebra 1.Matrix Notation 2.Sum/Difference of 2 matrices 3.Scalar multiple 4.Product of 2 matrices 5.Identity Matrix 6.Inverse of a matrix.
Concepts for Programming a Rigid Body Physics Engine Part 1 Presented by Scott Hawkins.
3D Kinematics Consists of two parts
Mathematical foundationsModern Seismology – Data processing and inversion 1 Some basic maths for seismic data processing and inverse problems (Refreshement.
2-2 Properties from Algebra
Introduction to Seismology
Analytic Geometry o f Space 3D Space (right-handed coordinate system) Introduction to Vectors –Let –We may to know the displacement from P to Q From P.
3D Game Engine Design 1 3D Game Engine Design Ch D MAP LAB.
10.4 Matrix Algebra 1.Matrix Notation 2.Sum/Difference of 2 matrices 3.Scalar multiple 4.Product of 2 matrices 5.Identity Matrix 6.Inverse of a matrix.
Graphics Graphics Korea University cgvr.korea.ac.kr Mathematics for Computer Graphics 고려대학교 컴퓨터 그래픽스 연구실.
Euler Angles This means, that we can represent an orientation with 3 numbers Assuming we limit ourselves to 3 rotations without successive rotations about.
Chapter 4 Vector Spaces Linear Algebra. Ch04_2 Definition 1: ……………………………………………………………………. The elements in R n called …………. 4.1 The vector Space R n Addition.
Derivation of the 2D Rotation Matrix Changing View from Global to Local X Y X’ Y’  P Y Sin  X Cos  X’ = X Cos  + Y Sin  Y Cos  X Sin  Y’ = Y Cos.
Computer Graphics Mathematical Fundamentals Lecture 10 Taqdees A. Siddiqi
Learning from the Past, Looking to the Future James R. (Jim) Beaty, PhD - NASA Langley Research Center Vehicle Analysis Branch, Systems Analysis & Concepts.
Chapter 4 Vector Spaces Linear Algebra. Ch04_2 Definition 1. Let be a sequence of n real numbers. The set of all such sequences is called n-space (or.
CHAPTER 3 VECTORS NHAA/IMK/UNIMAP.
MTH108 Business Math I Lecture 20.
CA 302 Computer Graphics and Visual Programming
Modeling Transformations
8.2 Kernel And Range.
Linear Equations in Linear Algebra
Introduction to Seismology
6.2 - Dot Product of Vectors
Copyright © Cengage Learning. All rights reserved.
Lecture 03: Linear Algebra
Vectors and the Geometry of Space
Chapter IV Spaces and Transforms
Use Inverse Matrices to Solve Linear Systems
Linear Equations in Linear Algebra
CSE 411 Computer Graphics Lecture #2 Mathematical Foundations
Homework Questions!.
A definition we will encounter: Groups
2 Vectors in 2-space and 3-space
Quaternions are back!!! A global quaternion q is defined as q = q0 + q where q = q1I+ q2 J+ q3K . where q0 is a scalar and q is a vector. A quaternion.
Rayat Shikshan Sanstha’s S.M.Joshi College, Hadapsar -28
Presentation transcript:

Chapter 2. Geometrical Methods - Quaternions - Mathematical summary of quaternion algebra & calculus Expalins how quaternions relate to rotations 전자공학/ Networked Virtual Computing Lab/ 조성업

Networked Virtual Computing Lab. Quaternion Algebra - 1 Quaternion definition q = w + xi + yj + zk Where w, x, y, z are real numbers i2 = j2 = k2 = -1 ij = -ji = k / jk = -kj = i / ki = -ik = j Algebra q0 = w0 + x0i + y0j + z0k / q1 = w1 + x1i + y1j + z1k Addition q0 + q1 = (w0 + w1) + ( x0 + x1 )i + ( y0 + y1 ) j + ( z0 + z1 )k Subtraction q0 - q1 = (w0 - w1) + ( x0 - x1 )i + ( y0 - y1 ) j + ( z0 - z1 )k Multiplication q0 * q1 = ( w0w1 - x0 x1 - y0y1 - z0z1 ) + (w0 x1 + x0 w1 + y0z1 + z0y1) i + (w0 y1 - x0 z1 + y0w1 + z0 x1) j + (w0 z1 + x0 y1 - y0 x1 + z0 w1) k 교환법칙 성립 안함 Networked Virtual Computing Lab.

Networked Virtual Computing Lab. Quaternion Algebra - 2 Conjugate of Quaternion q*= (w + xi + yj + zk ) * = w - xi - yj – zk ( q* )*= q ( pq)*= q*p* Norm of Quaternion Real value N(q) = N(w + xi + yj + zk) = w2 + x2 + y2 + z2 N(q) = N(q*) N(pq) = N(p)N(q) Networked Virtual Computing Lab.

Networked Virtual Computing Lab. Quaternion Algebra - 3 Multiplicate Inverse of Quaternion Notation: q  q-1 Property: q q-1 = q-1 q = 1 Inverse: q-1 = q* / N(q) Quaternion을 real-value scalar로 나눌때에는 w, x, y, z 각각을 나눈다. ( q-1 )-1 = q / ( pq ) -1 = q-1 p-1 Selection Function Select real part of Quaternion W(q) = W(w + xi + yj + zk) = w W(q) = ( q + q* ) / 2 Networked Virtual Computing Lab.

Networked Virtual Computing Lab. Quaternion Algebra - 4 3D-Vector view of Quaternion let v = xi + yj + zk = ( x, y, z ) q = w + v Multiplication q0 * q1 = ( w0 + v0 )( w1 + v1 ) = ( w0 w1 - v0  v1 ) + w0 v1 + w1 v0 + v0 v1 if v0 v1 = 0 ( parallel ) then q0 * q1 = q1 * q0 4D-Vector view of Quaternion 4D-Vector = (w, x, y, z) q0  q1 = w0w1 + x0x1 + y0y1 + z0z1 = W(q0 q1*) Unit Quaternion Quaternion q for which N(q) = 1 q = q-1 / qq = q q = cos + u sin  u = u0i + u1j +u2k = (u0 ,u1 ,u2 ) u has length 1 u u = -1 Networked Virtual Computing Lab.

Relationship of Quaternions to Rotations - 1 Unit Quaternion & Rotation let unit quaternion q = cos + u sin  then in R (v) = q v q* … R (v) 는 3D vector v 를 3차원 축 u 에 대해서 2 만큼 회전시키는 함수가 된다. R (v)가 rotation function 이라는 것을 증명하려면 다음 4가지를 증명해야만 한다. R (v) is a 3D-Vector R (v) is a length-preserving function R (v) is a linear transformation R (v) does not have an reflection component Networked Virtual Computing Lab.

Relationship of Quaternions to Rotations - 2 Proof 1: R (v) is a 3D-Vector W(R(v)) = W(q v q* ) = [(q v q* ) + (q v q* ) *] /2 = [(q v q* ) + q v *q* ] /2 = q[ (v + v *) / 2 ]q* = qW(v )q* = q  0  q* = 0 Proof 2: R (v) is a length-preserving function N(R(v)) = N(q v q* ) = N(q)N(v )N(q*) = N(q)N(v )N(q) = 1  N(v )  1 = N(v ) Networked Virtual Computing Lab.

Relationship of Quaternions to Rotations - 2 Proof 3: R (v) is a linear transformation R(av + w) = q (av + w) q* = q av q* + qw q* = a(q v q*) + qw q* = aR(v) + R(w) Proof 4: R (v) does not have an reflection component Let v = M(v) & v = M-1(v) w = M-1(w) = M-1(R(v)) = M-1(R(M(v))) w = P v P is dependent on unit quaternion q P(q) is an orthonormal matrix | det(P(q)) | = +1 or –1 For all unit quaternion q, | det(P(q)) | = +1 No refelection v w Rotation R(v) Quaternion계 M 실수계 Networked Virtual Computing Lab.

Relationship of Quaternions to Rotations - 3 Rotation axis & Rotation angle in Quaternion- 1 q = cos + u sin  & R (v) = q v q* Prove that in R … 3D-Vector u is the unit rotation axis the rotation angle is 2 Proof: 3D-Vector u is the unit rotation axis R(u) = q u q* = (cos + u sin ) u (cos - u sin ) = (cos) 2 u – (sin ) 2 u 3 = (cos) 2 u – (sin ) 2 (-u ) = u u 는 회전 후에도 그대로 유지되므로 회전 축이다. u 2 = -1 Networked Virtual Computing Lab.

Relationship of Quaternions to Rotations - 4 Rotation axis & Rotation angle in Quaternion- 2 Proof: the rotation angle is 2 Let u, v, w be a right-handed set of orthonormal vectors - All 3 vectors are unit length - u  v = u  w = v  w = 0 - u  v = w / v  w = u / w  u = v v  rotation()  q v q* : v  (q v q* ) = cos () For unit quaternions with zero real part p2 = -1 / v * = - v cos () = v  (q v q* ) = W(v* q v q* ) = W[- v (cos + u sin) v (cos - u sin)] = W[(-v cos -v u sin)(v cos - v u sin)] = W[- v2(cos)2 + v2u sin cos – vu v sin cos + (uv)2(sin)2] = W[(cos)2 - (sin)2 – (u + vu v )sin cos] (uv = - v  u + v u = v u = -w / vu v = -w v = wv -w  v = u ) Networked Virtual Computing Lab.

Networked Virtual Computing Lab. Continue… Rotation axis & Rotation angle in Quaternion- 3 Proof: the rotation angle is 2 cos () = W[(cos)2 - (sin)2 – (u + vu v )sin cos] = W[(cos)2 - (sin)2 – u (2 sin cos) ] = (cos)2 - (sin)2 = cos(2) Rotation angle is “ 2 ” Networked Virtual Computing Lab.

Conversion Between Angle-Axis & Rotation Matrix - 1 from Angle & Axis to Rotation Matrix  = angle of rotation / U = unit-length axis of rotation I = Identity matrix S = R = I + sin S + (1 – cos)S2 0 -u2 u1 u2 0 -u0 -u1 u0 0 Networked Virtual Computing Lab.

Conversion Between Angle-Axis & Rotation Matrix - 2 from Rotation Matrix to Angle & Axis Extract rotation angle  & unit-length rotation axis U from rotation matrix R trace(M) = sum of diagonal terms of matrix M Some Algebra cos = (trace(R) – 1)/2 R – RT = 2(sin)S  = cos-1( (trace(R) – 1)/2 )  [0, ]  = 0 : no rotation / any axis is valid   (0, ) : 두 번째 식을 이용해 S를 구하고 U 를 구한다.  = : R – RT = 0  U 를 구할 수 없다. 다음 식을 이용한다. R = I + S2 = 1-2(u12 + u22) 2(u0u1) 2(u0u2) 2(u0u1) 1-2(u02 + u22) 2(u1u2) 2(u0u2) 2(u1u2) 1-2(u02 + u12) Networked Virtual Computing Lab.

Conversion between Quaternion & Angle/Axis from Angle & Axis to Quaternion q = w + xi + yj + jk = cos(/2) + sin(/2)(u0i + u1j + u2k) U = (u0, u1, u2) 축을 기준으로 (radian)만큼 회전시키는 quaternion Rotation axis U 와 rotation angle  이 주어졌을 때의 quaternion은… w = cos(/2) / x = u0 sin(/2) y = u1 sin(/2) / z = u2 sin(/2) from Quaternion to Angle & Axis |w| = 1 :  = 0 & any axis will do |w|  1 :  = 2cos-1(w) & U = (x, y, z) /  1-w2 Networked Virtual Computing Lab.

Conversion between Quaternion & Rotation Matrix - 1 from Quaternion to Rotation Matrix Solution: w, x, y, z  find  & U  R = I + sin S + (1 – cos)S2 Some identities 2sin2(/2) = 1- cos  sin() = 2sin(/2)cos(/2) From above two identities… 2wx = (sin)u0 / 2wy = (sin)u1 / 2wz = (sin)u2 2x2 = ( 1 – cos )u02 / 2xy = (1 - cos )u0u1 / 2xz = (1 - cos )u0u2 2y2 = ( 1 – cos )u12 / 2yz = (1 - cos )u1u2 2z2 = ( 1 – cos )u22 Right-hand side of all above equations are terms in R = I + sin S + (1 – cos)S2  replacing them yields… R = 1-2y2 – 2z2 2xy + 2wz 2xz – 2wy 2xy – 2wz 1-2x2 – 2z2 2yz + 2wx 2xz + 2wy 2yz – 2wx 1-2x2 – 2y2 Networked Virtual Computing Lab.

Conversion between Quaternion & Rotation Matrix - 2 from Rotation Matrix to Quaternion given R find w, x, y, z, & (u0, u1, u2) Some algebra cos = (trace(R) – 1)/2 R – RT = 2(sin)S cos2(/2) = ( 1 + cos  )/2 Solution: from w = cos(/2) w2 = cos2(/2) = ( 1 + cos) /2 = ( 1+trace(R) )/4  |w| =  trace(R)+1 / 2 Trace(R) > 0 |w|>1/2 & choose positive w =  trace(R)+1 / 2 R – RT = 2(sin)S 를 이용해 U 계산 2wx = (sin)u0 / 2wy = (sin)u1 / 2wz = (sin)u2 를 이용해 x, y, z 계산 Trace(R)  0 |w|  1/2 R = 1-2y2 – 2z2 2xy + 2wz 2xz – 2wy 2xy – 2wz 1-2x2 – 2z2 2yz + 2wx 2xz + 2wy 2yz – 2wx 1-2x2 – 2y2 Networked Virtual Computing Lab.