Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 2. Geometrical Methods

Similar presentations


Presentation on theme: "Chapter 2. Geometrical Methods"— Presentation transcript:

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

2 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.

3 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.

4 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.

5 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.

6 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.

7 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* ) *] / = [(q v q* ) + q v *q* ] / = 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.

8 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.

9 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 = (cos) 2 u – (sin ) 2 (-u ) = u u 는 회전 후에도 그대로 유지되므로 회전 축이다. u 2 = -1 Networked Virtual Computing Lab.

10 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 = 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.

11 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) = cos(2) Rotation angle is “ 2 ” Networked Virtual Computing Lab.

12 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 u u0 -u1 u0 0 Networked Virtual Computing Lab.

13 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) (u0u1) (u0u2) 2(u0u1) (u02 + u22) 2(u1u2) 2(u0u2) (u1u2) (u02 + u12) Networked Virtual Computing Lab.

14 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.

15 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 – 2z xy + 2wz 2xz – 2wy 2xy – 2wz x2 – 2z yz + 2wx 2xz + 2wy yz – 2wx x2 – 2y2 Networked Virtual Computing Lab.

16 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) )/  |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 – 2z xy + 2wz 2xz – 2wy 2xy – 2wz x2 – 2z yz + 2wx 2xz + 2wy yz – 2wx x2 – 2y2 Networked Virtual Computing Lab.


Download ppt "Chapter 2. Geometrical Methods"

Similar presentations


Ads by Google