顯示具有 旋轉 標籤的文章。 顯示所有文章
顯示具有 旋轉 標籤的文章。 顯示所有文章

2022年5月31日 星期二

用矩陣方法處理橢圓旋轉後的方程式

目錄

1  矩陣的轉置
2  矩陣轉置的乘法
3  內積運算用矩陣乘法表達
4  橢圓的標準式
5  旋轉矩陣及其逆
6  旋轉橢圓的方程式

1  矩陣的轉置

        考慮域$K$ 上的$m \times n$矩陣$A$:

$$A = \begin{bmatrix} a_{11} & \cdots & a_{1n} \\ \vdots & & \vdots \\ a_{m1} & \cdots & a_{mn}  \end{bmatrix}.$$

其轉置$A^T$是域$K$ 上的$n \times m$矩陣:

$$A^T = \begin{bmatrix} a_{11} & \cdots & a_{m1} \\ \vdots & & \vdots \\ a_{1n} & \cdots & a_{mn}  \end{bmatrix}.$$

若命$A^T = B$,於是有

$$b_{ij} = a_{ji}, (1 \le i \le n, 1 \le j \le m.)$$

其中$b_{ij}$意味著矩陣$B$中的$(i, j)$位置元素,而$a_{ji}$是矩陣$A$中的$(j, i)$位置元素。

例1:

$$\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}^T = \begin{bmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{bmatrix}.$$

(例題終了)

2  矩陣轉置的乘法

定理1:在域$K$上,設$A$為$m \times n$矩陣、$B$為$n \times k$矩陣,於是有$(AB)^T = B^T A^T$。

[證]. 命$AB = C, (AB)^T = D, B^T = E, A^T = F$,於是

$$d_{ij} = c_{ji} = Ar(j) \cdot Bc(i) = \sum_{s = 1}^{n} a_{js} b_{si} = \sum_{s = 1}^{n} f_{sj} e_{is} = \sum_{s = 1}^{n} e_{is} f_{sj} = Er(i) \cdot Fc(j).$$

其中$Ar(i) = \begin{bmatrix} a_{i1} & \cdots & a_{in} \end{bmatrix}$,$Bc(j) = \begin{bmatrix} b_{1j} \\ \vdots \\ b_{nj} \end{bmatrix}$,餘類推。

(證明終了)

例2:取

$$A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}, B = \begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix}.$$

於是

$$A^T = \begin{bmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{bmatrix}, B^T = \begin{bmatrix} -1 & 0 & 1 \end{bmatrix},$$

然後

$$AB = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix} \begin{bmatrix} -1 \\ 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 2 \\ 2 \end{bmatrix}$$

因此

$$(AB)^T = \begin{bmatrix} 2 \\ 2 \end{bmatrix}^T = \begin{bmatrix} 2 & 2 \end{bmatrix}.$$

而

$$B^T A^T = \begin{bmatrix} -1 & 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 4 \\ 2 & 5 \\ 3 & 6 \end{bmatrix} = \begin{bmatrix} 2 & 2 \end{bmatrix}$$

所以有

$$(AB)^T = B^T A^T.$$

(例題終了)

3  內積運算用矩陣乘法表達

        考慮域$K$上的$n$維內積空間$K^n$,對於其中任意兩個向量$\bf{v}$與$\bf{w}$,

$${\bf v} = \begin{bmatrix} v_1 \\ \vdots \\ v_n \end{bmatrix}, {\bf w} = \begin{bmatrix} w_1 \\ \vdots \\ w_n \end{bmatrix},$$

定義其內積(inner product)為

$${\bf v} \cdot {\bf w} = v_1 w_1 + \cdots + v_n w_n.$$

如果我們將域$K$視作$1 \times 1$矩陣空間,於是有

$${\bf v} \cdot {\bf w} = \begin{bmatrix} v_1 w_1 + \cdots + v_n w_n \end{bmatrix} = \begin{bmatrix} v_1 & \cdots & v_n \end{bmatrix} \begin{bmatrix} w_1 \\ \vdots \\ w_n \end{bmatrix} = {\bf v}^T {\bf w}.$$

定理2:對於域$K$上的$n$維內積空間$K^n$中的任意兩個向量$\bf{v}$與$\bf{w}$,有

$${\bf v} \cdot {\bf w} = {\bf v}^T {\bf w}.$$

4  橢圓標準式的矩陣表述

        在$\mathbb{R}^2$中,二元二次方程式

$$\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$$

稱為「中心在原點的橢圓的標準式」。更精細地說,用方程式$\frac{x^2}{a^2} + \frac{y^2}{b^2} = 1$定義之橢圓$\Gamma$的集合描述為

$$\Gamma = \left \{ P = (x, y) \in \mathbb{R}^2  \mid \frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 \right \}.$$

現在,我們重新改寫橢圓標準式,改用矩陣語言來表示:

$$\frac{x^2}{a^2} + \frac{y^2}{b^2} = x \cdot \frac{x}{a^2} + y \cdot \frac{y}{b^2} = \begin{bmatrix} x \\ y \end{bmatrix} \cdot \begin{bmatrix} \frac{x}{a^2} \\ \frac{y}{b^2} \end{bmatrix} = \begin{bmatrix} x \\ y \end{bmatrix} \cdot \begin{bmatrix} \frac{1}{a^2} & 0 \\ 0 & \frac{1}{b^2} \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} x \\ y \end{bmatrix}^T \begin{bmatrix} \frac{1}{a^2} & 0 \\ 0 & \frac{1}{b^2} \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix}.$$

取$\overrightarrow{OP} = \begin{bmatrix} x \\ y \end{bmatrix} = {\bf v}$,$D = \begin{bmatrix} \frac{1}{a^2} & 0 \\ 0 & \frac{1}{b^2} \end{bmatrix}$,便可將橢圓標準式寫為

$${\bf v}^T D {\bf v} = 1.$$

(其中矩陣取名為$D$之理由為該矩陣是對角矩陣,diagonal matrix)於是橢圓$\Gamma$的集合描述可改寫為

$$\Gamma = \left\{ {\bf v} \in \mathbb{R}^2 \mid {\bf v}^T D {\bf v} = 1, D = \begin{bmatrix} \frac{1}{a^2} & 0 \\ 0 & \frac{1}{b^2} \end{bmatrix} \right\}.$$

例3:橢圓$\frac{x^2}{4} + \frac{y^2}{9} = 1$的矩陣方程式為

$$\begin{bmatrix} x & y \end{bmatrix} \begin{bmatrix} \frac{1}{4} & 0 \\ 0 & \frac{1}{9} \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = 1.$$

(例題終了)

例4:橢圓$3x^2 + 7y^2 = 1$的矩陣方程式為

$$\begin{bmatrix} x & y \end{bmatrix} \begin{bmatrix} 3 & 0 \\ 0 & 7 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = 1.$$

(例題終了)

5  旋轉矩陣及其逆

        在$\mathbb{R}^2$上,以原點$O$為旋轉中心,將向量$\bf v$循逆時針方向旋轉角度$\theta$的變換矩陣為

$$R_\theta = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}.$$

而此變換的逆的幾何意義就是將向量$\bf v$循逆時針方向旋轉角度$-\theta$,因此可得到

$$R_\theta^{-1} = R_{-\theta} = \begin{bmatrix} \cos (-\theta) & -\sin (-\theta) \\ \sin (-\theta) & \cos (-\theta) \end{bmatrix} = \begin{bmatrix} \cos \theta & \sin \theta \\ -\sin \theta & \cos \theta \end{bmatrix}.$$

再根據轉置的定義,可發現其實$\begin{bmatrix} \cos \theta & \sin \theta \\ -\sin \theta & \cos \theta \end{bmatrix} = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}^T$,亦即有

$$R_{\theta}^{-1} = \left\{ \begin{align*} &R_{-\theta} \\ &R_{\theta}^T \end{align*} \right. .$$

所以在計算旋轉矩陣的逆的時候,不需要引用逆矩陣公式,直接取其轉置即可。

例5:$R_{30^{\circ}} = \begin{bmatrix} \cos 30^{\circ} & - \sin 30^{\circ} \\ \sin 30^{\circ} & \cos 30^{\circ} \end{bmatrix} = \begin{bmatrix} \frac{\sqrt{3}}{2} & -\frac{1}{2} \\ \frac{1}{2} & \frac{\sqrt{3}}{2} \end{bmatrix}$,於是$R_{30^{\circ}}^{-1} = R_{30^{\circ}}^T = \begin{bmatrix} \frac{\sqrt{3}}{2} & -\frac{1}{2} \\ \frac{1}{2} & \frac{\sqrt{3}}{2} \end{bmatrix}^T = \begin{bmatrix} \frac{\sqrt{3}}{2} & \frac{1}{2} \\ -\frac{1}{2} & \frac{\sqrt{3}}{2} \end{bmatrix}$。

(例題終了)

6  旋轉橢圓的方程式

        現在考慮橢圓

$$\Gamma = \left\{ (x, y) \in \mathbb{R}^2 \mid \frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 \right\},$$

其矩陣方程式為${\bf v}^T D {\bf v} = 1$,${\bf v} = \begin{bmatrix} x \\ y \end{bmatrix}$,$D = \begin{bmatrix} \frac{1}{a^2} & 0 \\ 0 & \frac{1}{b^2} \end{bmatrix}$。然後以原點$O$為中心,逆時針方向旋轉角度$\theta$,命所得到的新橢圓為$\Gamma'$,於是對於任意$(x, y) \in \Gamma'$,必有

$$\left( R_{-\theta} {\bf v} \right)^T D \left( R_{-\theta} {\bf v} \right) = 1.$$

然後開始化簡左式,

$$\left( R_{-\theta} {\bf v} \right)^T D \left( R_{-\theta} {\bf v} \right) = {\bf v}^T \left( R_{-\theta} \right)^T D R_{\theta}^{-1} {\bf v} = {\bf v}^T \left( R_{\theta}^T \right)^T D R_{\theta}^{-1} {\bf v} = {\bf v}^T R_{\theta} D R_{\theta}^{-1} {\bf v}.$$

因此$\Gamma'$上的點必滿足方程式

$${\bf v}^T R_{\theta} D R_{\theta}^{-1} {\bf v} = 1.$$

        但請注意,我們現在只是證明$\Gamma'$上的點會滿足此方程式,但不表示滿足此方程式的所有點所構成的集合就是$\Gamma'$。例如以原點$O$為圓心、半徑為1,座落於第一、二象限的上半圓,其上每個點的坐標都滿足方程式$x^2 + y^2 = 1$,但方程式$x^2 + y^2 = 1$所代表的圖形卻是整個圓!

        取方程式${\bf v}^T R_{\theta} D R_{\theta}^{-1} {\bf v} = 1$的任一解${\bf v} = \begin{bmatrix} x \\ y \end{bmatrix}$,命${\bf w} = R_{-\theta} {\bf v}$,於是

$${\bf w}^T D {\bf w} = \left( R_{-\theta} {\bf v} \right)^T D \left( R_{-\theta} {\bf v} \right) = {\bf v}^T \left( R_{-\theta} \right)^T D R_{-\theta} {\bf v} = {\bf v}^T \left( R_{\theta}^T \right)^T D R_{\theta}^{-1} {\bf v} = {\bf v}^T R_{\theta} D R_{\theta}^{-1} {\bf v} = 1.$$

這意味著${\bf w} = R_{-\theta} {\bf v}$滿足方程式${\bf v}^T D {\bf v} = 1$,也就是說${\bf w}$向量的終點在橢圓$\Gamma$上,而${\bf w}$是${\bf v}$經$R_{-\theta}$變換而來,所以${\bf v}$必可由${\bf w}$經$R_{\theta}$變換而得,從而可確定${\bf v}$的終點在橢圓$\Gamma'$上。亦即方程式${\bf v}^T R_{\theta} D R_{\theta}^{-1} {\bf v} = 1$的任一解的終點都會是橢圓$\Gamma'$上的一點。

        因此我們就能完整確定方程式${\bf v}^T R_{\theta} D R_{\theta}^{-1} {\bf v} = 1$代表旋轉後的新橢圓!

定理3:橢圓$\Gamma: {\bf v}^T D {\bf v}$以原點$O$為旋轉中心、逆時針旋轉角度$\theta$後的新橢圓的方程式為$\Gamma': {\bf v}^T RDR^{-1} {\bf v}$。

例6:橢圓$\frac{x^2}{4} + \frac{y^2}{9} = 1$以原點$O$為中心、旋轉$30^{\circ}$後,新橢圓的方程式為何?

[解] 取${\bf v} = \begin{bmatrix} x \\ y \end{bmatrix}$、$D = \begin{bmatrix} \frac{1}{4} & 0 \\ 0 & \frac{1}{9} \end{bmatrix}$、$R = \begin{bmatrix} \cos 30^{\circ} & -\sin 30^{\circ} \\ \sin 30^{\circ} & \cos 30^{\circ} \end{bmatrix} = \begin{bmatrix} \frac{\sqrt{3}}{2} & \frac{-1}{2} \\ \frac{1}{2} & \frac{\sqrt{3}}{2} \end{bmatrix}$,於是

$$RDR^{-1} = \begin{bmatrix} \frac{\sqrt{3}}{2} & \frac{-1}{2} \\ \frac{1}{2} & \frac{\sqrt{3}}{2} \end{bmatrix} \begin{bmatrix} \frac{1}{4} & 0 \\ 0 & \frac{1}{9} \end{bmatrix} \begin{bmatrix} \frac{\sqrt{3}}{2} & \frac{1}{2} \\ \frac{-1}{2} & \frac{\sqrt{3}}{2} \end{bmatrix} = \begin{bmatrix} \frac{31}{144} & \frac{5 \sqrt{3}}{144} \\ \frac{5 \sqrt{3}}{144} & \frac{21}{144} \end{bmatrix}.$$

所以新橢圓方程式為

$$\begin{bmatrix} x & y \end{bmatrix} \begin{bmatrix} \frac{31}{144} & \frac{5 \sqrt{3}}{144} \\ \frac{5 \sqrt{3}}{144} & \frac{21}{144} \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = 1.$$

展開得

$$\frac{31}{144}x^2 + \frac{10 \sqrt{3}}{144} xy + \frac{21}{144}y^2 = 1.$$

(例題終了)

2022年5月24日 星期二

107指考數甲的複數問題

==問題== 

設$O$為複數平面上的原點,並令點$A, B$分別代表複數$z_1, z_2$,且滿足$|z_1| = 2, |z_2| = 3, |z_2 - z_1| = \sqrt{5}$。若$\frac{z_2}{z_1} = a+bi$,其中$a, b$為實數,$i = \sqrt{-1}$。試選出正確的選項。

(1)  $\cos \angle AOB = \frac{2}{3}$

(2)  $|z_2 + z_1| = \sqrt{23}$

(3)  $a > 0$

(4)  $b > 0$

(5)  設點$C$代表$\frac{z_2}{z_1}$,則$\angle BOC$可能等於$\frac{\pi}{2}$

[107,指考,數甲]

==答案==

(1), (3), (5)

==解答==

        由$|z_1| = 2$可假設$z_1 = 2(\cos \theta_1 + i \sin \theta_1)$。

        由$|z_2| = 3$可假設$z_2 = 3(\cos \theta_2 + i \sin \theta_2)$。

        於是

$$z_2 - z_2 = (3 \cos \theta_2 - 2 \cos \theta_1) + i (3 \sin \theta_2 - 2 \sin \theta_1).$$

由$|z_2 - z_1| = \sqrt{5}$得

$$\sqrt{(3 \cos \theta_2 - 2 \cos \theta_1)^2 + (3 \sin \theta_2 - 2 \sin \theta_1)^2} = \sqrt{5}.$$

左右平方得

$$(3 \cos \theta_2 - 2 \cos \theta_1)^2 + (3 \sin \theta_2 - 2 \sin \theta_1)^2 = 5.$$

對左式展開得

$$9 \cos^2 \theta_2 - 12 \cos \theta_2 \cos \theta_1 + 4 \cos^2 \theta_1 + 9 \sin^2 \theta_2 - 12 \sin \theta_2 \sin \theta_1 + 4 \sin^2 \theta_1 = 5.$$

整理為

$$9(\cos^2 \theta_2 + \sin^2 \theta) -12 (\cos \theta_2 \cos \theta_1 + \sin \theta_2 \sin \theta_1) + 4(\cos^2 \theta_1 + \sin^2 \theta_1) = 5,$$

$$9 - 12 \cos (\theta_2 - \theta_1) + 4 = 5,$$

就得到

$$\cos (\theta_2 - \theta_1) = \frac{2}{3}.$$

由平方恆等式$\cos^2 \varphi + \sin^2 \varphi = 1$有

$$\sin (\theta_2 - \theta_1) = \pm \sqrt{1 - \left( \frac{2}{3} \right)^2} = \pm \frac{\sqrt{5}}{3}.$$

由$\frac{z_2}{z_1} = a+bi$得

$$\frac{3(\cos \theta_2 + i \sin \theta_2)}{2(\cos \theta_1 + i \sin \theta_1)} = a+bi.$$

利用複數極式的除法關係得

$$\frac{3}{2}\left[ \cos (\theta_2 - \theta_1) + i \sin (\theta_2 - \theta_1) \right] = a + bi.$$

因此

$$a = \frac{3}{2} \cos (\theta_2 - \theta_1) = \frac{3}{2} \cdot \frac{2}{3} = 1,$$

$$b = \frac{3}{2} \sin (\theta_2 - \theta_1) = \frac{3}{2} \cdot \left( \pm \frac{\sqrt{5}}{3} \right) = \pm \frac{\sqrt{5}}{2}.$$

        下面開始討論每一個選項。

        (1) 正確。

由$z_2 = z_1 \cdot \frac{z_2}{z_1} = z_1 \cdot \left( 1 \pm \frac{\sqrt{5}}{2}i \right) = z_1 \cdot \frac{3}{2} \left( \frac{2}{3} \pm \frac{\sqrt{5}}{3} \right)$可知點$B$是由點$A$以原點$O$為旋轉中心、逆/順時針旋轉$\arccos \frac{2}{3}$後,再伸縮$\frac{3}{2}$倍而得。注意此時點$B$的位置有2種可能。無論如何,必有$\cos \angle AOB = \frac{2}{3}$。

        (2) 錯誤。

因為

$$\begin{align*} |z_2 + z_1|&= \left| 3(\cos \theta_2 + i \sin \theta_2) + 2(\cos \theta_1 + i \sin \theta_1) \right| \\ &= \left|  (3 \cos \theta_2 + 2 \cos \theta_1) + i (3 \sin \theta_2 + 2 \sin \theta_1) \right|  \\ &= \sqrt{(3 \cos \theta_2 + 2 \cos \theta_1)^2 + (3 \sin \theta_2 + 2 \sin \theta_1)^2} \\ &= \sqrt{9 + 12 \cos (\theta_2 - \theta_1) + 4} \\ &= \sqrt{21}.  \end{align*}$$

       (3) 正確。

因為$a = \frac{3}{2}$。

       (4) 錯誤。

因為$b = \pm \frac{\sqrt{5}}{2}$。

       (5) 正確。

因為$z_2 = \frac{z_2}{z_1} \cdot z_1 = \frac{z_2}{z_1} \cdot 2(\cos \theta_1 + i \sin \theta_1)$,所以可知點$B$是由點$C$以原點$O$為旋轉中心、逆時針旋轉$\theta_1$後,再伸縮2倍而得。設$\theta_1$的最小正同界角為$\theta_1^+$,則$\angle BOC = \theta_1^+$或$2\pi - \theta_1^+$。特別當我們取$\theta_1 = \frac{\pi}{2}$時,就有$\angle BOC = \frac{\pi}{2}$。因此$\angle BOC$確實可能等於$\frac{\pi}{2}$。

(解答終了)

==附註==

雖然這是一道幾何問題,但我硬是把解答寫的像是代數問題一樣嚴謹而仔細,沒有放示意圖。我當然可以很幾何地處理這道問題,不過倘若太依賴圖形,選項(5)很容易出問題。我大部分都是幾何學取向,偶爾會突然切換為代數取向,追求極致的邏輯嚴謹。

2021年11月22日 星期一

用幾何意義處理一道雙曲線積分問題

前兩天在twitter上看到一到積分題


很顯然就是得利用部分積分法與三角代換去處理。

該推文附上的解答為


其實也不甚困難。

不過我偏好用幾何眼光處理問題,所以下面的解法是90%的幾何、10%的代數/微積分。

首先注意被積函數$y = \sqrt{x^2+1}$是雙曲線$y^2 - x^2 = 1$的一個分支,我們將之圖形繪出,並標出幾個線段的長度,如下所示。


於是所求的積分$\int \limits^{1}_{0} \sqrt{x^2+1} \, dx$就是「曲邊梯形」OACB的面積,而此塊面積可以分解如
$$OACB = \Delta BOE + \Delta OEA + \Delta DEA + \text{曲邊四邊形}CDEB.$$
其中$\Delta BOE, \Delta OEA, \Delta DEA$都是一樣的等腰直角三角形,邊長為$\frac{\sqrt{2}}{2}$,面積為$\frac{\sqrt{2}}{2} \times \frac{\sqrt{2}}{2} \times \frac{1}{2} = \frac{1}{4}$,所以這三塊面積為$\frac{3}{4}$。

下面接著處理曲邊四邊形CDEB。由於$CDEB = CFDEB - \Delta CDF$,所以誘導我們去考慮將圖形進行順時針$45^{\circ}$旋轉,得下圖。

原本的雙曲線$y^2 - x^2 = 1$經過旋轉後變為$y = \pm \frac{1}{2x}$。於是
$$CFDEB = \int \limits_{\frac{\sqrt{2}}{2}}^{1+\frac{\sqrt{2}}{2}} \frac{1}{2x} \, dx = \frac{1}{2} \int \limits_{\frac{\sqrt{2}}{2}}^{1+\frac{\sqrt{2}}{2}} \frac{1}{x} \, dx = \frac{1}{2} \left[ \ln \left( 1+\frac{\sqrt{2}}{2} \right) - \ln \frac{\sqrt{2}}{2} \right] = \frac{1}{2} \ln \left( 1+\sqrt{2} \right).$$

所以

$$CDEB = CFDEB - \Delta CDF = \frac{1}{2} \ln \left( 1+\sqrt{2} \right) - \left( 1 - \frac{\sqrt{2}}{2} \right)^2 \times \frac{1}{2} = \frac{1}{2} \ln \left( 1+\sqrt{2} \right) - \frac{3}{4} + \frac{\sqrt{2}}{2}.$$

然後

\begin{align*}\int \limits^{1}_{0} \sqrt{x^2+1} \, dx &= \Delta BOE + \Delta OEA + \Delta DEA + CDEB \\ &= \frac{3}{4} + \frac{1}{2} \ln \left( 1+\sqrt{2} \right) - \frac{3}{4} + \frac{\sqrt{2}}{2} \\ & = \frac{\sqrt{2}}{2} + \frac{1}{2} \ln \left( 1+\sqrt{2} \right) \end{align*}

(解答終了)

 可愛妹子時間~

涼本奈緒好可愛呀!!!(@naosuzumoto)