# 李宏毅_Linear Algebra Lecture 21: Coordinate System ###### tags: `Hung-yi Lee` `NTU` `Linear Algebra Lecture` [課程撥放清單](https://www.youtube.com/playlist?list=PLJV_el3uVTsNmr39gwbyV-0KjULUsN7fW) ## Linear Algebra Lecture 21: Coordinate System [課程連結](https://www.youtube.com/watch?v=im3kTm9jGEM&list=PLJV_el3uVTsNmr39gwbyV-0KjULUsN7fW&index=21) ### Outline ![](https://i.imgur.com/5A486Bp.png) Basis可以被以Coordinate System來看待。所謂的Coordinate System就是一種拿來描述vector的觀點,也因此,相同的vector在不同的Coordinate System就會有不同的表示方式。換句話說,不同的vector在不同的Coordinate System是有可能會有相同的表示方式的。 註:Coordinate System可翻譯文座標系 ### Vector ![](https://i.imgur.com/EVtLETZ.png) 以左圖二維向量為例,其實我們是用$e_1, e_2$兩個standard vector來描述這個二維向量。而$e_1, e_2$所組成的coordinate set就是coordinate system,也就是standard vector所組成的座標系,而且我們假設是在直角座標系。 但並不一定要這麼假設,右圖來看,我們使用另外的座標系。要注意的是,不同的座標系統,得到的雖然一樣是8、4,但這時候的座標已經是6、-2。 相同的vector,不同的座標系來說明,就會得到不同的結果。 ### Vector ![](https://i.imgur.com/i3zDylj.png) 在不同的座標系上,相同的座標不一定會得到相同的vector。也就是左圖直角座標系的2、3並不會等於右邊不同座標系的2、3,因為右邊的2、3最終得到的是4、2.5。 ### Coordinate System ![](https://i.imgur.com/k3RX5Sh.png) 並非所有的vector set都可以拿來做為Coordinate System,必需滿足下面兩個條件: 1. vector set必須要可以span R^n^,也就是R^n^內所有向量都可以用這個vector set做linear combination而得 2. vector set必須是independent,如果不是,那相同的vector在這個Coordinate System上就會有不同的representation 而這兩個條件加起來即代表這個vector set就是R^n^的basis,也因此,vector set要拿來做Coordinate System,就必需是R^n^的basis。 ### Why Basis? ![](https://i.imgur.com/PcppIyw.png) 這邊說明為何vector set是independent,它的representation就會是唯一的: * 假設有一組vector set $B = \left\{ u_1, u_2, \cdots, u_k \right\}$ * 假設有一組coefficient,$a_1, a_2, \cdots, a_k$,inear combination得到$v$ * 假設有另一組coefficient,$b_1, b_2, \cdots, b_k$,linear combination之後也會得到$v$ * 兩個linear combination之後的$v$相減可以得到$(a_1 - b_1)u_1 + (a_2 - b_2)u_2 + \cdots (a_k - b_k)u_k = 0$ * 根據independent的定義,如果independent的vector set要做linear combination之後產生zero vector,就只有一個可能,那就是coefficient皆為0,也因此$a_1 - b_1 = a_2 - b_2 = cdots = a_k - b_k = 0$ ### Coordinate System ![](https://i.imgur.com/FtRvmdE.png) 假設有一個$R^n$ subspace的basis-$B = \left\{ u_1, u_2, \cdots, u_n \right\}$,因為subspace是$R^n$,因此其basis的數目一定是$n$,因此其成員為$B = \left\{ u_1, u_2, \cdots, u_n \right\}$。 將basis拿來做為Coordinate System使用,這意味著,隨便一個$R^n$空間中的vector-$v$,找出一組coefficient,用這個coefficient對$\left\{ u_1, u_2, \cdots, u_n \right\}$做linear combination會得到$v$,接著將所用的coefficient-$\left\{ c_1, c_2, \cdots, c_n \right\}$拿出來,這個vector就是在$B$這個Coordinate System下,看$v$的representation,也就是$B$-corrdinate vector of v。 簡單說就是,你有一個coordinate system-$B$,將它裡面的成員做linear combination之後得到$v$,執行這個linear combination的coefficient,就是$v$在$B$下的representation,寫為$\left[ v \right]B$,代表在$B$這個coordinate system下看$v$的樣子。 ### Coordinate System ![](https://i.imgur.com/DtGK09x.png) $\left[ v \right]B$ * $v$是一個vector,由standard vectors所形成的Coordinate System,也就是在直角座標系下看到的$v$,因為在沒有指定座標系之前根本無法描述,因此會假設為直角座標系 * $\left[ v \right]B$,$v$依然為一個vector,只是這時候是在$B$這個座標系所描述的新的vector 直角坐標系,又稱笛卡爾坐標系 ### Other System -> Cartesian ![](https://i.imgur.com/M2c0bpi.png) 上面是兩個案例說明,同一個vector在不同的coordinate system上不同的representation ### Other System -> Cartesian ![](https://i.imgur.com/TTfsOoW.png) 一般來說,我們有一個coordinate system-$B$,它是由一堆vector所組成,將這些vector視為某一個matrix的column,以matrix的方式來表示。 在給定$\left[ v \right]B$的情況下,如果想還原為直接座標系上表示的$v$,就只需要計算$c_1u_1 + c_2u_2 + \cdots + c_nu_n$,也就是Matrix-B乘上$\left[ v \right]B$ ### Cartesian -> Other System ![](https://i.imgur.com/wN8ssot.png) 這是一個將一個vector放置於其它的coordinate system上的範例。 假設你有一個直角座標系的vector-$v$,另外有一個coordinate system-$B$,該如何找出$\left[ v \right]_B$,也就是找出$B$跟一組coefficient做內積之後得到$v$的那組coefficient。因為上一小節提到,還原直接座標系的方法就是計算$c_1u_1 + c_2u_2 + \cdots + c_nu_n$,也就是B$\left[ v \right]_B=v$ B$\left[ v \right]_B=v$的兩邊同乘B^-1^,即$\left[ v \right]_B=$B^-1^$v$。B是一個independent的vector set,因此它永遠都會是可逆的。 ### Cartesian -> Other System ![](https://i.imgur.com/kjUB1tI.png) 這邊總結說明,假設有一個coordinate system-$B = \left\{ b_1, b_2, \cdots, b_n \right\}$,相同的一個vector,在直角座標系上是$v$,在$B$這個座標系上是$\left[ v\right]_B$: * 要從$v$轉到$\left[ v\right]_B$就乘上B^-1^ * 要從$\left[ v\right]_B$轉到$v$就乘上B 簡報最下面說著,假設有一個coordinate system-$B = \left\{ b_1, b_2, \cdots, b_n \right\}$,其中的某一個成員$b_i$,它在這個coordinate system下看起來會是$e_i$,也就是$B$這個座標系的成員在自己這個座標系上看起來都會是standard vector。 ### Equation of ellipse ![](https://i.imgur.com/ibbIxZp.png) 案例說明橢圓由直角座標轉至另一個座標系該如何表示。 ### Equation of ellipse ![](https://i.imgur.com/g3wdxaY.png) 把你的頭歪一邊來看這個橢圓,它就變正的。我們可以定義一個新的座標系-$B$。 原本的直角座標系中,我們的向量是$v$,有著$x, y$兩個元素,而相同的向量在$\left[ v \right]_B$中,變成$x', y'$。 因此橢圓在新的座標系的方程式變成$\dfrac{{x'}^2}{3^2} + \dfrac{(y')^2}{2^2} = 1$,現在只要知道$x', y'$與$x, y$之間的關係就可以計算出來。 ### Equation of ellipse ![](https://i.imgur.com/QH0toV6.png) 剛才已經知道,要從$v$轉到$\left[ v\right]_B$就乘上B^-1^,因此$\left[ v \right]_B = B^{-1}v$,因此可以知道,$x, y$乘上$B^{-1}$就可以得到$x', y'$,得到$x', y'$就可以得到斜橢圓的方程式。 ### Equation of hyperbola ![](https://i.imgur.com/UekSkTW.png) 假設有一個雙曲線,其方程式為$-\sqrt{3}x^2 + 2xy + \sqrt{3}y^2 = 12$,請說明這雙曲線在$x', y'$的表示。假設,指示$x'$的紅色箭頭與x中間的夾角為30度。 ### Equation of hyperbola ![](https://i.imgur.com/qdOxlzB.png) 首先,寫下我們的coordinate system寫下來(不一定要長度一樣,也不一定要互相垂直,只要是independent就可以)。 我們知道,$v = B\left[v\right]_B$,寫下來之後就可以知道$x, y$與$x', y'$之間的關係。 ### Equation of hyperbola ![](https://i.imgur.com/zYyRO07.png) 取代掉$x, y$,計算之後就可以得到$x'y'=3$