跳到主要内容

東京大学 情報理工学系研究科 創造情報学専攻 2012年8月実施 筆記試験 第3問

Author​

itsuitsuki

Description​

Official examination, archived Japanese PDF. In kinematic calculations and visual computations in robotics, vector operations are expressed with matrices sometimes. Answer the following questions on inner-product, outer-product, projection and rotation of three dimensional vectors. I\boldsymbol{I} is the 3×33\times3 identity matrix. The three-dimensional vectors x\boldsymbol{x}, a\boldsymbol{a}, b\boldsymbol{b} and n\boldsymbol{n} are 3×13\times1 column vectors: x=[xxxyxz],a=[axayaz],b=[bxbybz],n=[nxnynz].\boldsymbol{x}=\begin{bmatrix}x_x\\x_y\\x_z\end{bmatrix},\quad\boldsymbol{a}=\begin{bmatrix}a_x\\a_y\\a_z\end{bmatrix},\quad\boldsymbol{b}=\begin{bmatrix}b_x\\b_y\\b_z\end{bmatrix},\quad\boldsymbol{n}=\begin{bmatrix}n_x\\n_y\\n_z\end{bmatrix}. xT\boldsymbol{x}^T, which is a 1×31\times3 row vector, shows the transpose of x\boldsymbol{x}.

(1) On the inner product (a,b)(\boldsymbol{a},\boldsymbol{b}) between vectors a\boldsymbol{a} and b\boldsymbol{b}, describe i) the value of (a,b)(\boldsymbol{a},\boldsymbol{b}), ii) a 3×33\times3 matrix A\boldsymbol{A} which satisfies (a,b)a=Ab(\boldsymbol{a},\boldsymbol{b})\boldsymbol{a}=\boldsymbol{A}\boldsymbol{b}, and iii) A\boldsymbol{A} with vector a\boldsymbol{a} and its transpose aT\boldsymbol{a}^T.

(2) On the outer product a×b\boldsymbol{a}\times\boldsymbol{b} from a\boldsymbol{a} to b\boldsymbol{b}, describe i) 3×13\times1 expression of a×b\boldsymbol{a}\times\boldsymbol{b}, ii) 3×33\times3 expression of the matrix A\boldsymbol{A} which satisfies a×b=Ab\boldsymbol{a}\times\boldsymbol{b}=\boldsymbol{A}\boldsymbol{b}, iii) the 3×33\times3 matrix Q\boldsymbol{Q} which satisfies A=a×Q\boldsymbol{A}=\boldsymbol{a}\times\boldsymbol{Q} where x×Q\boldsymbol{x}\times\boldsymbol{Q} between a vector x\boldsymbol{x} and a 3×33\times3 matrix Q\boldsymbol{Q} means a 3×33\times3 matrix whose column vectors are three outer products from the vector x\boldsymbol{x} to each column vector in the matrix Q\boldsymbol{Q} respectively.

(3) As Figure 1 shows, a vector x\boldsymbol{x} is vertically projected to a vector y\boldsymbol{y} on a plane whose normal vector is a unit vector n\boldsymbol{n}. If the vector y\boldsymbol{y} is described as y=Px\boldsymbol{y}=\boldsymbol{P}\boldsymbol{x}, show that the matrix P\boldsymbol{P} becomes P=I−nnT\boldsymbol{P}=\boldsymbol{I}-\boldsymbol{n}\boldsymbol{n}^T.

(4) Three rotational matrices Rx(θx)\boldsymbol{R}_x(\theta_x), Ry(θy)\boldsymbol{R}_y(\theta_y) and Rz(θz)\boldsymbol{R}_z(\theta_z) are rotational matrices which rotate a vector x\boldsymbol{x} around the X-axis, Y-axis and Z-axis with θx\theta_x, θy\theta_y and θz\theta_z respectively, where the direction of the rotation for plus is clock-wise around the axis from the origin to infinity.

i) Describe 3×33\times3 expression of the matrix Rx(θx)\boldsymbol{R}_x(\theta_x), ii) As Figure 2 shows, the 3×33\times3 matrix Rn(θn)\boldsymbol{R}_n(\theta_n) is defined as the rotation matrix around a unit orientation vector n\boldsymbol{n} with θn\theta_n. Rn(θn)\boldsymbol{R}_n(\theta_n) is described as Rn(θn)=Rx(−α)Ry(β)Rz(θn)Ry(−β)Rx(α).\boldsymbol{R}_n(\theta_n)=\boldsymbol{R}_x(-\alpha)\boldsymbol{R}_y(\beta)\boldsymbol{R}_z(\theta_n)\boldsymbol{R}_y(-\beta)\boldsymbol{R}_x(\alpha). Explain what the variables α\alpha and β\beta become and explain why the expression is satisfied.

题目描述​

机器人运动学和视觉计算常用矩阵表示向量运算。回答三维向量的内积、外积、投影与旋转问题。令 I\boldsymbol I 为 3×33\times3 单位矩阵,并令

x=[xxxyxz],a=[axayaz],b=[bxbybz],n=[nxnynz]\boldsymbol{x}=\begin{bmatrix}x_x\\x_y\\x_z\end{bmatrix},\quad \boldsymbol{a}=\begin{bmatrix}a_x\\a_y\\a_z\end{bmatrix},\quad \boldsymbol{b}=\begin{bmatrix}b_x\\b_y\\b_z\end{bmatrix},\quad \boldsymbol{n}=\begin{bmatrix}n_x\\n_y\\n_z\end{bmatrix}

均为 3×13\times1 列向量;xT\boldsymbol x^T 是其 1×31\times3 转置行向量。

  1. 对 a,b\boldsymbol a,\boldsymbol b 的内积 (a,b)(\boldsymbol a,\boldsymbol b),分别写出:a. 内积数值;b. 满足

    (a,b)a=Ab(\boldsymbol a,\boldsymbol b)\boldsymbol a=\boldsymbol A\boldsymbol b

    的 3×33\times3 矩阵 A\boldsymbol A;c. 用 a,aT\boldsymbol a,\boldsymbol a^T 表示该 A\boldsymbol A。

  2. 对从 a\boldsymbol a 到 b\boldsymbol b 的外积 a×b\boldsymbol a\times\boldsymbol b,分别写出:a. 其 3×13\times1 分量表达式;b. 满足 a×b=Ab\boldsymbol a\times\boldsymbol b=\boldsymbol A\boldsymbol b 的 3×33\times3 矩阵 A\boldsymbol A;c. 满足 A=a×Q\boldsymbol A=\boldsymbol a\times\boldsymbol Q 的 3×33\times3 矩阵 Q\boldsymbol Q。这里 x×Q\boldsymbol x\times\boldsymbol Q 定义为 3×33\times3 矩阵,其每一列分别是 x\boldsymbol x 与 Q\boldsymbol Q 对应列向量的外积。

  3. 如图 1,把 x\boldsymbol x 正交投影到法向量为单位向量 n\boldsymbol n 的平面,得到 y\boldsymbol y。若 y=Px\boldsymbol y=\boldsymbol P\boldsymbol x,证明

    P=I−nnT.\boldsymbol P=\boldsymbol I-\boldsymbol n\boldsymbol n^T.
  4. Rx(θx),Ry(θy),Rz(θz)\boldsymbol R_x(\theta_x),\boldsymbol R_y(\theta_y),\boldsymbol R_z(\theta_z) 分别把向量绕 X,Y,ZX,Y,Z 轴旋转 θx,θy,θz\theta_x,\theta_y,\theta_z;从原点沿轴正方向看去,顺时针规定为正。

    1. 写出 Rx(θx)\boldsymbol R_x(\theta_x) 的 3×33\times3 形式。

    2. 如图 2,Rn(θn)\boldsymbol R_n(\theta_n) 表示绕单位方向向量 n\boldsymbol n 旋转 θn\theta_n,且

      Rn(θn)=Rx(−α)Ry(β)Rz(θn)Ry(−β)Rx(α).\boldsymbol R_n(\theta_n)= \boldsymbol R_x(-\alpha)\boldsymbol R_y(\beta)\boldsymbol R_z(\theta_n) \boldsymbol R_y(-\beta)\boldsymbol R_x(\alpha).

      求 α,β\alpha,\beta,并解释该矩阵分解成立的原因。

Kai​

Here “outer product” in part (2) means the three-dimensional cross product a×b\boldsymbol a\times\boldsymbol b. It should be distinguished from the matrix outer product abT\boldsymbol a\boldsymbol b^T.

(1) Inner product​

i) The scalar inner product is

(a,b)=axbx+ayby+azbz=aTb.(\boldsymbol a,\boldsymbol b)=a_xb_x+a_yb_y+a_zb_z=\boldsymbol a^T\boldsymbol b.

ii) A matrix that gives (a,b)a(\boldsymbol a,\boldsymbol b)\boldsymbol a for every b\boldsymbol b is

A=(ax2axayaxazayaxay2ayazazaxazayaz2).\boxed{\boldsymbol A=\begin{pmatrix} a_x^2&a_xa_y&a_xa_z\\ a_ya_x&a_y^2&a_ya_z\\ a_za_x&a_za_y&a_z^2 \end{pmatrix}.}

iii) In vector notation, A=aaT\boxed{\boldsymbol A=\boldsymbol a\boldsymbol a^T}, because Ab=a(aTb)\boldsymbol A\boldsymbol b=\boldsymbol a(\boldsymbol a^T\boldsymbol b).

(2) Cross product​

i)

a×b=(aybz−azbyazbx−axbzaxby−aybx).\boxed{\boldsymbol a\times\boldsymbol b= \begin{pmatrix}a_yb_z-a_zb_y\\a_zb_x-a_xb_z\\a_xb_y-a_yb_x\end{pmatrix}.}

ii) The corresponding skew-symmetric matrix is

A=[a]×=(0−azayaz0−ax−ayax0).\boxed{\boldsymbol A=[\boldsymbol a]_\times= \begin{pmatrix}0&-a_z&a_y\\a_z&0&-a_x\\-a_y&a_x&0\end{pmatrix}.}

iii) Taking Q=I\boxed{\boldsymbol Q=\boldsymbol I} works: its columns are the coordinate basis vectors, and the columns a×ei\boldsymbol a\times\boldsymbol e_i are exactly those of [a]×[\boldsymbol a]_\times. This choice is not unique for a fixed nonzero a\boldsymbol a: the general solution is Q=I+avT\boldsymbol Q=\boldsymbol I+\boldsymbol a\boldsymbol v^T for any vector v\boldsymbol v, because each column may be changed by a multiple of a\boldsymbol a. If a=0\boldsymbol a=0, every Q\boldsymbol Q works.

(3) Orthogonal projection​

The plane of vectors is nTy=0\boldsymbol n^T\boldsymbol y=0, through the origin. Decompose x\boldsymbol x into its normal component (nTx)n(\boldsymbol n^T\boldsymbol x)\boldsymbol n and its component in the plane. Because nTn=1\boldsymbol n^T\boldsymbol n=1,

y=x−(nTx)n=(I−nnT)x.\boldsymbol y=\boldsymbol x-(\boldsymbol n^T\boldsymbol x)\boldsymbol n =(\boldsymbol I-\boldsymbol n\boldsymbol n^T)\boldsymbol x.

Thus P=I−nnT\boxed{\boldsymbol P=\boldsymbol I-\boldsymbol n\boldsymbol n^T}. Indeed nTP=0\boldsymbol n^T\boldsymbol P=0, so the result lies in the plane, and x−Px\boldsymbol x-\boldsymbol P\boldsymbol x is parallel to its normal. Also PT=P\boldsymbol P^T=\boldsymbol P and P2=P\boldsymbol P^2=\boldsymbol P. For an affine plane not through the origin, an additional translation term would be necessary.

(4) Rotation about an arbitrary axis​

i) “Clockwise looking from the origin toward the positive axis” is the right-hand rotation convention; looking back toward the origin would reverse the apparent direction. In particular a positive rotation about XX sends ey\boldsymbol e_y toward ez\boldsymbol e_z. Therefore

Rx(θ)=(1000cos⁡θ−sin⁡θ0sin⁡θcos⁡θ).\boxed{\boldsymbol R_x(\theta)= \begin{pmatrix}1&0&0\\0&\cos\theta&-\sin\theta\\0&\sin\theta&\cos\theta\end{pmatrix}.}

For clarity the other matrices in the factorization use the same active-rotation convention:

Ry(θ)=(cos⁡θ0sin⁡θ010−sin⁡θ0cos⁡θ),Rz(θ)=(cos⁡θ−sin⁡θ0sin⁡θcos⁡θ0001).\boldsymbol R_y(\theta)=\begin{pmatrix}\cos\theta&0&\sin\theta\\0&1&0\\-\sin\theta&0&\cos\theta\end{pmatrix},\qquad \boldsymbol R_z(\theta)=\begin{pmatrix}\cos\theta&-\sin\theta&0\\\sin\theta&\cos\theta&0\\0&0&1\end{pmatrix}.

ii) Let r=ny2+nz2r=\sqrt{n_y^2+n_z^2}. If r>0r>0, choose

α=atan2⁡(ny,nz),β=atan2⁡(nx,r).\boxed{\alpha=\operatorname{atan2}(n_y,n_z),\qquad \beta=\operatorname{atan2}(n_x,r).}

Thus cos⁡α=nz/r\cos\alpha=n_z/r, sin⁡α=ny/r\sin\alpha=n_y/r, cos⁡β=r\cos\beta=r and sin⁡β=nx\sin\beta=n_x, using the unit length of n\boldsymbol n. These choices successively give

Rx(α)n=(nx,0,r)T,Ry(−β)(nx,0,r)T=(0,0,1)T.\boldsymbol R_x(\alpha)\boldsymbol n=(n_x,0,r)^T,\qquad \boldsymbol R_y(-\beta)(n_x,0,r)^T=(0,0,1)^T.

Define C=Ry(−β)Rx(α)\boldsymbol C=\boldsymbol R_y(-\beta)\boldsymbol R_x(\alpha). First C\boldsymbol C aligns the rotation axis with ZZ, then Rz(θn)\boldsymbol R_z(\theta_n) rotates around that aligned axis, and finally C−1\boldsymbol C^{-1} restores the original coordinates. Reading matrix actions from right to left,

Rn(θn)=C−1Rz(θn)C=Rx(−α)Ry(β)Rz(θn)Ry(−β)Rx(α).\boxed{\boldsymbol R_n(\theta_n)=\boldsymbol C^{-1}\boldsymbol R_z(\theta_n)\boldsymbol C =\boldsymbol R_x(-\alpha)\boldsymbol R_y(\beta)\boldsymbol R_z(\theta_n) \boldsymbol R_y(-\beta)\boldsymbol R_x(\alpha).}

If r=0r=0, then n=(±1,0,0)T\boldsymbol n=(\pm1,0,0)^T; choose α=0\alpha=0 and β=±π/2\beta=\pm\pi/2. This avoids an undefined atan2⁡(0,0)\operatorname{atan2}(0,0) and yields the same factorization. An independent equivalent formula is Rodrigues' expression

Rn(θ)=cos⁡θ I+(1−cos⁡θ)nnT+sin⁡θ [n]×,\boldsymbol R_n(\theta)=\cos\theta\,\boldsymbol I+(1-\cos\theta)\boldsymbol n\boldsymbol n^T +\sin\theta\,[\boldsymbol n]_\times,

which also makes the fixed axis and rotation sign explicit.