GoPiGo 小汽車︰格點圖像算術《投影幾何》【五‧線性代數】《導引六‧上》

且讓我們將『單點透視』放在以『投影中心』 P 為『齊次座標』之『原點』的平面上作考察︰

 

如果依舊選用『本地座標系』︰

A \  {\overset {P}{\doublebarwedge }} \ A^{'}B \  {\overset {P}{\doublebarwedge }} \ B^{'}C \  {\overset {P}{\doublebarwedge }} \ C^{'}

\overline{AB} 是線 l 上的『單位長度』,任意一點 C 之『賦值』為 t = \frac{\overline{CA}}{\overline{CB}} = \frac{u}{u -1}, \ u =_{df} \frac{\overline{CA}}{\overline{AB}} 。對應之

\overline{A^{'}B{'}} 是線 l^{'} 上的『單位長度』,任意一點 C^{'} 之『賦值』為 t^{'} = \frac{\overline{C^{'}A^{'}}}{\overline{C^{'}B^{'}}} = \frac{v}{v -1}, \ v =_{df} \frac{\overline{C^{'}A^{'}}}{\overline{A^{'}B^{'}}}

ll^{'} 間的『幾何事實』仍然是

\frac{\frac{\overline{CA}}{\overline{CB}}}{\frac{\overline{C^{'}A^{'}}}{\overline{C^{'}B{'}}} } = \frac{\frac{\overline{PA}}{\overline{PB}}}{\frac{\overline{PA^{'}}}{\overline{PB^{'}}}} = constant = \frac{1}{k} = \frac{t}{t^{'}}

因此『透視』間之『數值關係』還是︰

f_P ={\begin{cases} k \cdot t,&{\mbox{if }} U \in l \\ \frac{t^{'}}{k} ,&{\mbox{if }} V \in l^{'} \end{cases}

f_P ={\begin{cases}  \frac{u}{(1- \frac{1}{k}) u + \frac{1}{k}},&{\mbox{if }} U \in l \\ \frac{v}{(1-k)v +k} ,&{\mbox{if }} V \in l^{'} \end{cases}

 

若說使用這麼麻煩的『記號法』,祇為著講『兩線間之透視』,其『點與點』間『函數』,滿足『對射定義』︰

Bijection

In mathematics, a bijection, bijective function or one-to-one correspondence is a function between the elements of two sets, where each element of one set is paired with exactly one element of the other set, and each element of the other set is paired with exactly one element of the first set. There are no unpaired elements. In mathematical terms, a bijective function f: XY is a one-to-one (injective) and onto (surjective) mapping of a set X to a set Y.

A bijection from the set X to the set Y has an inverse function from Y to X. If X and Y are finite sets, then the existence of a bijection means they have the same number of elements. For infinite sets the picture is more complicated, leading to the concept of cardinal number, a way to distinguish the various sizes of infinite sets.

A bijective function from a set to itself is also called a permutation.

Bijective functions are essential to many areas of mathematics including the definitions of isomorphism, homeomorphism, diffeomorphism, permutation group, and projective map.

 

※ 註

可以『講說』的一切都用著『語言』,人們用『物理學語言』說明『物理事件』,用『心理學語言』講述『心理現象』。只要『論及數量』就不得不用『數學語言』。所以數學語言必然成了『科學語言』的重要組成『環節』,它使得我們可以『定量』的談論著『關係式』或是數量間滿足的『方程式』,用之以『預測』未來『將發生』或者『可發生』的種種。假如它的預測『結果』卻是不幸的『不準』,然而此又剛好能成了科學『進步的動力』,難道真的是魚與熊掌果能兼得的嗎??如果縱觀橫看歷史源流,數學這個科學語言之王,有著『記號法』持續之『變革』一事,可以讓那些好『不容易』獲得的『成果』能以『簡潔』、『易記』與『易用』的方式『被表達』,也就是說它的『傳承』之『精煉』是有著這一個重要的『面象』,雖然它也許很容易就會『被忽略

就讓我們『以管窺豹』談談什麼是數學中的『表達式』的『表達』作為開始吧。通常『四則運算』的寫法將運算符號 +  –  *  /  擺在式子中間,又有著先『乘除』後『加減』的規定,所以使用『括號』強制運算次序就無法避免。比方說 ( 3 + 4 ) * 53 + 4  * 5 的差異。波蘭數學家 Jan Łukasiewicz  曾經提到︰

我在一九二四年突然有了一個無需括號的表達方法,我在文章第一次使用了這種表示法。

,這就是『波蘭表示法』的開始。這個表示法將運算符號放在運算之數目『之前』,故稱作『前綴表示法』,舉前例說就是︰* + 3 4 5+ 3 * 4 5。這個表示法是這樣看二元運算⊕□○』 的,這裡的『⊕』是 + – * / 的某一運算;□或○代表『子表達式』,有著表達式相同的結構。如果一個子表達式只有數目,沒有運算符號,那就是『最簡』的表達式。這樣就將它看成了一棵 『二元運算樹』。所謂計算法就是『先找出』有『兩個最簡子表達式』之二元運算『先算』,再將計算的結果數目『迭代』那個表達式,如是一步步計算下去,最後要不就能得到正確『答案』,要不就是表達式有『錯誤』。舉個例吧,(3 + 4) * (7 - 2 * 3) 的答案是 7 ,用波蘭表示法寫作

* + 3  4 – 7 * 2  3
= *  7 – 7  6
= *  7  1
= 7

假使你將二元運算『⊕□○』看成數學上的『函數』function ── 比方說代表著 ⊕( □,○ )  ──,這就是 LISP 程式語言常用的表達式寫法,其實上許多程式語言內部都用著這樣的表達式記號法。現今『functional』泛函的或者說功能的一詞推廣了函數概念,成了一種寫程式的『典範』。由於波蘭表示法的計算方式過於麻煩,說不定還容易算錯,揚‧武卡謝維奇又提出『逆波蘭表示法』,不再把運算符號放在前面,卻是將它置於後頭的『後綴表示法』,如此二元運算寫成了『□○⊕』。這樣的寫法有什麼好處呢?最大的好處就是『計算規則』簡單︰

看到數目就將它放上『堆疊』Stack 頂端,

見著運算符號,如果堆疊頂端能取下兩數,取下運算後將結果放回堆疊頂端;如果堆疊頂端不能取下兩數,表達式有錯誤,

最終堆疊頂端將只有答案一數,否則表達式有錯誤。

─── 摘自《測不準原理

 

乾脆說『反演』存在吧!!

t, t^{'} 容易計算

f_P(f_P(C))  \equiv f_P(C^{'}) = f_P(k \cdot t) = \frac{1}{k} \cdot (k \cdot t) = t \equiv C

u, v 需要化簡

f_P(f_P(u)) = u

pi@raspberrypi:~ ipython3 Python 3.4.2 (default, Oct 19 2014, 13:31:11)  Type "copyright", "credits" or "license" for more information.  IPython 2.3.0 -- An enhanced Interactive Python. ?         -> Introduction and overview of IPython's features. %quickref -> Quick reference. help      -> Python's own help system. object?   -> Details about 'object', use 'object??' for extra details.  In [1]: from sympy import *  In [2]: init_printing()  In [3]: u, v, k = symbols('u, v, k')  In [4]: f = u / ( (1-1/k) * u + 1/k)  In [5]: f Out[5]:        u       ─────────────   ⎛    1⎞   1 u⋅⎜1 - ─⎟ + ─   ⎝    k⎠   k  In [6]: g = v / ( (1-k) * v + k)  In [7]: g Out[7]:        v        ────────────── k + v⋅(-k + 1)  In [8]: g.subs(v , f) Out[8]:                   u                  ─────────────────────────────────── ⎛      u⋅(-k + 1) ⎞ ⎛  ⎛    1⎞   1⎞ ⎜k + ─────────────⎟⋅⎜u⋅⎜1 - ─⎟ + ─⎟ ⎜      ⎛    1⎞   1⎟ ⎝  ⎝    k⎠   k⎠ ⎜    u⋅⎜1 - ─⎟ + ─⎟                 ⎝      ⎝    k⎠   k⎠                  In [9]: g.subs(v , f).simplify() Out[9]: u  In [10]:  </pre>    <span style="color: #666699;">如是按『語意約定』,或可簡化為︰</span>  <span style="color: #666699;"> \left( \begin{array}{cc} v \\ 1 \end{array} \right)  = \  \left( \begin{array}{cc}  \frac{u}{(1- \frac{1}{k}) u + \frac{1}{k}} \\ 1 \end{array} \right)  \   {\overset {P}{\doublebarwedge }}  \   \left( \begin{array}{cc} 1 & 0 \\ 1 - \frac{1}{k} & \frac{1}{k}  \end{array} \right) \left( \begin{array}{cc} u \\ 1 \end{array} \right) ;</span>  <span style="color: #666699;"> \left( \begin{array}{cc} u \\ 1 \end{array} \right) = \  \left( \begin{array}{cc}  \frac{v}{(1- k) v + k} \\ 1 \end{array} \right)  \  {\overset {P}{\doublebarwedge }}  \  { \left( \begin{array}{cc} 1 & 0 \\ 1 - \frac{1}{k} & \frac{1}{k}  \end{array} \right)}^{-1} \left( \begin{array}{cc} v \\ 1 \end{array} \right) </span>  <span style="color: #666699;">{\overset {P}{\doublebarwedge }}  \   \left( \begin{array}{cc} 1 & 0 \\ 1 - k & k  \end{array} \right) \left( \begin{array}{cc} v \\ 1 \end{array} \right) $ 的乎??!!