Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 112

Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 112

Notice: Trying to access array offset on value of type bool in /home1/freesand/public_html/wp-content/plugins/wiki-embed/WikiEmbed.php on line 116
FreeSandal | 輕。鬆。學。部落客 | 第 199 頁

光的世界︰矩陣光學一

儘管為文主旨是想介紹『矩陣光學』實務應用,如果假設讀者已知 □ ○,這樣只需列出

Table of ray transfer matrices

for simple optical components

Element Matrix Remarks
Propagation in free space or in a medium of constant refractive index \begin{pmatrix} 1 & d\\ 0 & 1 \end{pmatrix} d = distance
Refraction at a flat interface \begin{pmatrix} 1 & 0 \\ 0 & \frac{n_1}{n_2} \end{pmatrix} n1 = initial refractive index
n2 = final refractive index.
Refraction at a curved interface \begin{pmatrix} 1 & 0 \\ \frac{n_1-n_2}{R \cdot n_2} & \frac{n_1}{n_2} \end{pmatrix} R = radius of curvature, R > 0 for convex (centre of curvature after interface)
n1 = initial refractive index
n2 = final refractive index.
Reflection from a flat mirror  \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} Only valid for mirrors perpendicular to the ray.
Reflection from a curved mirror   {\displaystyle {\begin{pmatrix}1&0\\-{\frac {2}{R_{e}}}&1\end{pmatrix}}} {\displaystyle R_{e}=R\cos \theta } effective radius of curvature in tangential plane (horizontal direction)
  {\displaystyle R_{e}=R/\cos \theta } effective radius of curvature in the sagittal plane (vertical direction)
R = radius of curvature, R > 0 for concave, valid in the paraxial approximation
\theta is the mirror angle of incidence in the horizontal plane.
Thin lens  \begin{pmatrix} 1 & 0 \\ -\frac{1}{f} & 1 \end{pmatrix} f = focal length of lens where f > 0 for convex/positive (converging) lens.Only valid if the focal length is much greater than the thickness of the lens.
Thick lens \begin{pmatrix} 1 & 0 \\ \frac{n_2-n_1}{R_2n_1} & \frac{n_2}{n_1} \end{pmatrix} \begin{pmatrix} 1 & t \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ \frac{n_1-n_2}{R_1n_2} & \frac{n_1}{n_2} \end{pmatrix} n1 = refractive index outside of the lens.
n2 = refractive index of the lens itself (inside the lens).
R1 = Radius of curvature of First surface.
R2 = Radius of curvature of Second surface.
t = center thickness of lens.
Single right angle prism  \begin{pmatrix} k & \frac{d}{nk} \\ 0 & \frac{1}{k} \end{pmatrix} k = (cos  \psi /cos ϕ  \phi ) is the beam expansion factor, where  \phi is the angle of incidence,  \psi is the angle of refraction, d = prism path length, n = refractive index of the prism material. This matrix applies for orthogonal beam exit.

 

就好。但思『事理不二』,要是『理』都不清,『事』能明乎??那又何必曾講『勸學篇』也!!

訊 ︰☿ 把酒飛斝是同道,欲法荀子《勸學篇》趁年少︰

君子曰:學不可以已。青,取之於藍而青於藍;冰,水為之而寒於水。以喻學則才過其本性也。木直中繩,輮以為輪,其曲中規,雖有槁暴,不復挺者,輮使之然也。輮,屈。槁,枯。曓,乾。挻,宜也。《晏子春秋》作「不復贏也」。故木受繩則直,金就礪則利,君子博學而日參省乎己,則知明而行無過矣。參,三也。曾子曰︰「日三省吾身。」知,讀爲智。行,下孟反。故不登高山,不知天之高也;不臨深谿,不知地之厚也;不聞先王之遺言,不知學問之大也。大,謂有益於人。干、越、夷、貉之子,生而同聲,長而異俗,教使之然也。干、越,猶言吳、越。《呂氏春秋》「荊有次非得寶劍於干、越」,高誘曰︰「吳邑也。」貉,東北夷。同聲,謂啼聲同。貉,莫革反。《詩》曰:「嗟爾君子,無恆安息。靖共爾位,好是正直。神之聽之,介爾景福。」《詩》,《小雅‧小明》之篇。靖,謀。介,助。景,大也。無恆安息,戒之不使懷安也。言能謀恭其位,好正宜之道,則神聽而助之福,引此詩以喻勤學也。神莫大於化道,福莫長於無禍。爲學則自化道,故神莫大焉。修身則自無禍,故福莫長焉。吾嘗終日而思矣,不如須臾之所學也,吾嘗跂而望矣,不如登高之博見也 。跂,舉足也。登高而招,臂非加長也,而見者遠;順風而呼,聲非加疾也,而聞者彰。假輿馬者,非利足也,而致千里;假舟楫者,非能水也,而絕江河。能,善。絶,過。君子生非異也,善假於物也。皆以喻修身在假於學。生非異,言與衆人同也。南方有鳥焉,名曰蒙鳩,以羽為巢而編之以髮,繫之葦苕,風至苕折,卵破子死。巢非不完也 ,所繫者然也。蒙 鳩,鷦鷯也。苕,葦之秀也,今巧婦鳥之巢至精密,多繫於葦竹之上是也。「蒙」當爲「蔑」。《方言》雲︰「鷦鷯,關而西謂之桑飛,或謂之蔑雀。」或曰︰一名 蒙鳩,亦以其愚也。言人不知學問,其所置身亦猶繫葦之危也。《說苑》︰「客謂孟嘗君曰︰『鷦鷯巢於葦苕,箸之髮毛,可謂完堅矣,大風至則苕折卵破子死者何 也?其所託者然也。』西方有木焉,名曰射干,莖長四寸,生於高山之上,而臨百仞之淵,木莖非能長也,所立者然也 。《本草》藥名有射干,一名烏扇。陶弘景雲︰「花白莖長,如射人之執竿。」又引阮公詩云「射干臨層城」,是生於高處也。據《本草》在《草部》中,又生南陽川穀,此雲「西方有木」,未詳。或曰︰「長四寸」卽是草,雲木,誤也。蓋生南陽,亦生西方也。射音夜。蓬生麻中,不扶而直。蘭槐之根是爲芷。其漸之滫,君子不近,庶人不服,其質非不美也,所漸者然也。蘭槐,香草,其根是爲芷也。《本草》︰「白芷一名白茝。」陶弘景雲︰「卽《離騷》所謂蘭茝也。」葢苗名蘭茝,根名芷也。弱槐當是蘭茝別名,故云「蘭槐之根是爲芷」也。漸,漬也,染也。滫,溺也。言雖香草,浸漬於溺中,則可惡也。漸,子廉反。滫,思酒反。故君子居必擇鄉,遊必就士,所以防邪僻而近中正也。物類之起,必有所始。榮辱之來,必象其德。肉腐出蟲,魚枯生蠹。怠慢忘身,禍災乃作。強自取柱,柔自取束。凡物強則以爲柱而任勞,柔則見束而約急,皆其自取也。邪穢在身,怨之所構。構,結也。言亦所自取。施薪若一,火就燥也;布薪於地,均若一,火就燥而焚之矣。平地若一,水就溼也。草木疇生,禽獸羣焉,物各從其類也。疇與儔同,類也。是故質的張而弓矢至焉,林木茂而斧斤至焉,所謂召禍也。質,射矦。的,正鵠也。樹成蔭而衆鳥息焉,醯酸而蜹聚焉。喻有德則慕之者衆。故言有召禍也,行有招辱也,君子慎其所立乎!禍福如此,不可不慎所立。所立,卽謂學也。

積土成山,風雨興焉;積水成淵,蛟龍生焉;積善成德,而神明自得,聖心備焉。神明自得,謂自通於神明。故不積蹞步,無以千里;半步曰蹞。蹞與跬同。不積小流,無以成江海。騏驥一躍,不能十步;駑馬十駕,言駑馬十度引車,則亦及騏驥之一躍。據下雲「駑馬十駕,則亦及之」,此亦當同,疑脫一句。功在不舍。鍥而舍之,朽木不折;鍥而不舍 ,金石可鏤。言立功在於不舍。舍與捨同。鍥,刻也,苦結反。《春秋傳》曰「陽虎借邑人之車,鍥其軸」也。螾無爪牙之利,筋骨之強,上食埃土,下飲黃泉,用心一也。螾與蚓同,蚯蚓也。蟹八跪而二螯,非虵蟺之穴無可寄託者,用心躁也。跪,足也。《韓子》以刖足爲刖跪。螫,蟹首上如鉞者。許叔重《說文》雲「蟹六足二螫」也。是故無冥冥之志者無昭昭之明 ,無惛惛之事者無赫赫之功。冥冥、惛惛,皆專默精誠之謂也。行衢道者不至,事兩君者不容。《爾雅》雲︰「四達謂之衢。」孫炎雲︰「衢,交道四出也。」或曰︰衢道,兩道也。不至,不能有所至。下篇有「楊朱哭衢塗」。今秦俗猶以兩爲衢,古之遺言歟?目不能兩視而明,耳不能兩聽而聰。螣蛇無足而飛,《爾雅》云:「螣,螣蛇。」郭璞雲「龍類,能興雲霧而遊其中」也。梧鼠五技而窮。「梧鼠」當爲「鼫鼠」,蓋本誤爲「鼯」字,傳寫又誤爲「梧」耳。技,才能也。言技能雖多而不能如螣蛇專一,故窮。五技,謂能飛不能上屋,能緣不能窮木,能游不能渡谷,能穴不能掩身,能走不能先人。《詩》曰 :「屍鳩在桑,其子七兮。淑人君子,其儀一兮。其儀一兮,心如結兮。」故君子結於一也。《詩》,《曹風‧屍鳩》之篇。毛雲︰「屍鳩,鴶鞠也。屍鳩之養七子,旦從上而下,暮從下而上,平均如一。善人君子,其執義亦當如屍鳩之一。執義一則用心堅固。」故曰「心如結」也。

……… 摘自《M♪o 之學習筆記本《編者跋》

 

豈非對好學者太失禮耶??!!

聽聞楊百翰大學多年來開設光學教育課程︰

Optics Education Home

Over the past several years, the Department of Physics and Astronomy at Brigham Young University has developed an advanced optics course for undergraduates under the direction of Justin B. Peatross. This web page provides access to resources related to this course. To access a specific resource, choose from the menu on the left.

The textbook used for this course may be freely used for non-profit educational purposes. The text discusses electromagnetic wave phenomena, including polarization effects, interference, coherence, dispersion, ray theory, and diffraction. We are developing an introduction to quantum nature of light. The laboratory component emphasizes applications, and demonstrate the basic optics principles. Each lab has an instructional video that can be acceessed on this site. We are also in the process of making animations and other illustrations to illustrate basic optics principles.

This project is supported in part by the National Science Foundation Division of Undergraduate Education (Grant number DUE-9952773).

 

幸得 Justin Peatross 與 Michael Ware 先生們之慷慨︰

光學著作權聲明

 

可以省憂少勞矣!!!故此還請讀者先讀

Optics Textbook

Physics of Light and Optics is a high-quality free textbook desiged for an advanced undergraduate optics course for physics majors. It is used at universities around the world. You are welcome to use the text for your course or personal study or for a formal course within the following guidelines:

  • The text may not be sold for profit. If you would like to use it in a class, you may provide copies to the students for the cost of printing.
  • Please do not publish solutions to the homework problems.
  • Please let us know if you use the text for either personal or classroom study; we would like to know how widely the book is used!

The textbook is available in PDF format on this web site, and also as a printed and bound copy available for the cost of printing, available here:

The authors (Justin Peatross and Michael Ware) welcome constructive feedback, which can be sent to opticsbook@byu.edu.

Why an online textbook?

While the authors retain the copyright to the book, we have made this book available free of charge as our contribution toward a future with free textbooks! We firmly believe in the free market system, and in the case of upper division physics textbooks, traditional publishing methods usually make little economic sense for the author or reader.  The small royalty from traditional publishing comes with a giant overhead that make the book nearly cost prohibitive to many students (especially those in developing countries), and the author gives up control of his work to the publishing company.  Electronic tools make it easy to produce and distribute a professional product (see our section on creating a textbook), and it can be revised, corrected, and enhanced on the authors’ timetable. If you are thinking about publishing a book this way, we highly recommend it.

 

之『第九章』

Light_as_Rays

 

踏上旅程吧!!??

 

 

 

 

 

 

 

 

 

 

光的世界︰派生科學計算八

仲夏入園中東陂‧唐‧儲光羲

方塘深且廣,伊昔俯吾廬。
環岸垂綠柳,盈澤發紅蕖。
上延北原秀,下屬幽人居。
暑雨若混沌,清明如空虛。
此鄉多隱逸,水陸見樵漁。
廢賞亦何貴,為歡良易攄。
且言重觀國,當此賦歸歟。

 

欲究 skimage 相似變換之理︰

SimilarityTransform

class skimage.transform.SimilarityTransform(matrix=None, scale=None, rotation=None, translation=None)

Bases: skimage.transform._geometric.EuclideanTransform

2D similarity transformation of the form:

X = a0 * x – b0 * y + a1 =
= s * x * cos(rotation) – s * y * sin(rotation) + a1
Y = b0 * x + a0 * y + b1 =
= s * x * sin(rotation) + s * y * cos(rotation) + b1

where s is a scale factor and the homogeneous transformation matrix is:

[[a0  b0  a1]
 [b0  a0  b1]
 [0   0    1]]

The similarity transformation extends the Euclidean transformation with a single scaling factor in addition to the rotation and translation parameters.

Parameters:

matrix : (3, 3) array, optional

Homogeneous transformation matrix.

scale : float, optional

Scale factor.

rotation : float, optional

Rotation angle in counter-clockwise direction as radians.

translation : (tx, ty) as array, list or tuple, optional

x, y translation parameters.

Attributes

params ((3, 3) array) Homogeneous transformation matrix.

 

,如墜混沌中,莫非是因暑雨後,頭昏腦不清!這 X 何指?那 Y 又是什麼 □ ○ ??考之 draw 模組圓盤和線段之說明︰

circle

skimage.draw.circle(r, c, radius, shape=None)
Generate coordinates of pixels within circle.

Parameters:

r, c : double

Centre coordinate of circle.

radius : double

Radius of circle.

shape : tuple, optional

Image shape which is used to determine the maximum extent of output pixel coordinates. This is useful for circles which exceed the image size. By default the full extent of the circle are used.

Returns:

rr, cc : ndarray of int

Pixel coordinates of circle. May be used to directly index into an array, e.g. img[rr, cc] = 1.

Notes

This function is a wrapper for skimage.draw.ellipse()

……

line

skimage.draw.line()
Generate line pixel coordinates.

Parameters:

y0, x0 : int

Starting position (row, column).

y1, x1 : int

End position (row, column).

Returns:

rr, cc : (N,) ndarray of int

Indices of pixels that belong to the line. May be used to directly index into an array, e.g. img[rr, cc] = 1.

See also

line_aa
Anti-aliased line generator

 

明示『列』 row 與『行』 column !!yx 之前,難道是講︰(r,  c) = (y,  x) 耶??既然無由計,方塘深且廣,怎不直搗黃龍,親驗座標系乎!!且以笛卡爾座標系── 橫平 x  、豎直 y ,右手逆旋角度為正,左手順轉角度為負 ── 考察一番︰

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]: import numpy as np  In [2]: import matplotlib.pyplot as plt  In [3]: from skimage.transform import warp, SimilarityTransform  In [4]: from skimage.draw import circle, line  In [5]: 圓 = lambda r,c: (r - 100)**2 + (c - 200)**2 <= 100  In [6]: 圖像 = np.fromfunction(圓, (512,512))  In [7]: 圖像[line(100,200,150,300)] = True  In [8]: plt.gray()  In [9]: plt.imshow(圖像) Out[9]: <matplotlib.image.AxesImage at 0x706e2ef0>  In [10]: plt.show()  In [11]: y平移 = SimilarityTransform(scale=1, rotation=0,translation=(0, 50))  In [12]: y平移圖 = warp(圖像, y平移.inverse)  In [13]: y平移圖[circle(100,200,10)] = True  In [14]: y平移圖[line(100,200,150,300)] = True  In [15]: plt.imshow(y平移圖) Out[15]: <matplotlib.image.AxesImage at 0x718b5290>  In [16]: plt.show()  In [17]: x平移 = SimilarityTransform(scale=1, rotation=0,translation=(50, 0))  In [18]: x平移圖 = warp(圖像, x平移.inverse)  In [19]: x平移圖[circle(100,200,10)] = True  In [20]: x平移圖[line(100,200,150,300)] = True  In [21]: plt.imshow(x平移圖) Out[21]: <matplotlib.image.AxesImage at 0x6fe4dd50>  In [22]: plt.show()  In [23]: 逆旋轉 = SimilarityTransform(scale=1, rotation=3.14159/18,translation=(0, 0))  In [24]: 逆旋轉圖 =  warp(圖像, 逆旋轉.inverse)  In [25]: 逆旋轉圖[circle(100,200,10)] = True  In [26]: 逆旋轉圖[line(100,200,150,300)] = True  In [27]: plt.imshow(逆旋轉圖) Out[27]: <matplotlib.image.AxesImage at 0x6f811770>  In [28]: plt.show()  In [29]: 順旋轉 = SimilarityTransform(scale=1, rotation=-3.14159/18,translation=(0, 0))  In [30]: 順旋轉圖 =  warp(圖像, 順旋轉.inverse)  In [31]: 順旋轉圖[circle(100,200,10)] = True  In [32]: 順旋轉圖[line(100,200,150,300)] = True  In [33]: plt.imshow(順旋轉圖) Out[33]: <matplotlib.image.AxesImage at 0x6f6a0170>  In [34]: plt.show()  In [35]:  </pre>    <span style="color: #808080;">【圖像】</span>  <img class="alignnone size-full wp-image-56929" src="http://www.freesandal.org/wp-content/uploads/圖像.png" alt="圖像" width="652" height="553" />     <span style="color: #808080;">【y平移圖】</span>  <img class="alignnone size-full wp-image-56928" src="http://www.freesandal.org/wp-content/uploads/y平移圖.png" alt="y平移圖" width="652" height="553" />     <span style="color: #808080;">【x平移圖】</span>  <img class="alignnone size-full wp-image-56927" src="http://www.freesandal.org/wp-content/uploads/x平移圖.png" alt="x平移圖" width="652" height="553" />     <span style="color: #808080;">【逆旋轉圖】</span>  <img class="alignnone size-full wp-image-56930" src="http://www.freesandal.org/wp-content/uploads/逆旋轉圖.png" alt="逆旋轉圖" width="652" height="553" />     <span style="color: #808080;">【順旋轉圖】</span>  <img class="alignnone size-full wp-image-56931" src="http://www.freesandal.org/wp-content/uploads/順旋轉圖.png" alt="順旋轉圖" width="652" height="553" />     <span style="color: #003300;">果然是『列』、『行』為Y、X$ !!當真的呢鏡中定『右逆』、『左順』之轉向也!!為何這樣寫??只覺太忽悠??

金文大篆倏

金文大篆忽

倏的本意︰
狗因杖打疾速逃窜。

《説文解字》:倏,走也。从犬,攸聲。

忽之語源︰
未放在心上,不重视。

《説文解字》:忽,忘也。从心,勿聲。

220px-西山經-帝江.svg

盤古

風雲變色

山海經‧西次三經》:

又西三百五十里曰天山,多金玉,有青雄黃,英水出焉,而西南流注於湯谷。有神焉,其狀如黃囊,赤如丹火,六足四翼,渾敦無面目是識歌舞,實惟帝江也

莊子‧內篇‧應帝王》︰

南海之帝為倏,北海之帝為忽,中央之帝為混沌。
倏與忽時相與遇於混沌之地,混沌待之甚善。
倏與忽謀報混沌之德,曰:

人皆有七竅,以視聽食息,此獨無有,嘗試鑿之。

日鑿一竅,七日而混沌死。

不 知莊子是否在忽悠人的嗎?混沌和盤古有無關係的呢??

─── 摘自《混沌理論

 

總不會想教人將文件看清楚,不明白時請反覆實驗吧??!!其後偶讀

 

skimagelogo

A crash course on NumPy for images

……

Coordinate conventions

Because we represent images with numpy arrays, our coordinates must match accordingly. Two-dimensional (2D) grayscale images (such as camera above) are indexed by row and columns (abbreviated to either row, col or r, c), with the lowest element (0, 0) at the top- -left corner. In various parts of the library, you will also see rr and cc refer to lists of row and column coordinates. We distinguish this from (x, y), which commonly denote standard Cartesian coordinates, where x is the horizontal coordinate, y the vertical, and the origin is on the bottom right. (Matplotlib, for example, uses this convention.)

In the case of color (or multichannel) images, the last dimension contains the color information and is denoted channel or ch.

Finally, for 3D images, such as videos, magnetic resonance imaging (MRI) scans, or confocal microscopy, we refer to the leading dimension as plane, abbreviated as pln or p.

These conventions are summarized below:

Dimension name and order conventions in scikit-image
Image type coordinates
2D grayscale (row, col)
2D multichannel (eg. RGB) (row, col, ch)
3D grayscale (pln, row, col)
3D multichannel (pln, row, col, ch)

 

只能哈哈大笑,何得清明如空虛矣!!!

 

 

 

 

 

 

 

 

 

 

 

 

 

光的世界︰派生科學計算七

送子由使契丹蘇軾

雲海相望寄此身,那因遠適更沾巾。
不辭驛騎淩風雪,要使天驕識鳳麟。
沙漠回看清禁月,湖山應夢武林春。
單於若問君家世,莫道中朝第一人。

 

既談派生科學計算,如果沒介紹『SciPy』套件集成,當真不道地也。無奈耶雲海無涯!不得不屢屢遠謫矣?

scipy-logo

Scientific Computing Tools for Python

 SciPy refers to several related but distinct entities:
  • The SciPy Stack, a collection of open source software for scientific computing in Python, and particularly a specified set of core packages.
  • The community of people who use and develop this stack.
  • Several conferences dedicated to scientific computing in Python – SciPy, EuroSciPy and SciPy.in.
  • The SciPy library, one component of the SciPy stack, providing many numerical routines.

The SciPy Stack

Core Packages

  • Python, a general purpose programming language. It is interpreted and dynamically typed and is very suited for interactive work and quick prototyping, while being powerful enough to write large applications in.
  • NumPy, the fundamental package for numerical computation. It defines the numerical array and matrix types and basic operations on them.
  • The SciPy library, a collection of numerical algorithms and domain-specific toolboxes, including signal processing, optimization, statistics and much more.
  • Matplotlib, a mature and popular plotting package, that provides publication-quality 2D plotting as well as rudimentary 3D plotting
  • pandas, providing high-performance, easy to use data structures.
  • SymPy, for symbolic mathematics and computer algebra.
  • IPython, a rich interactive interface, letting you quickly process data and test ideas. The IPython notebook works in your web browser, allowing you to document your computation in an easily reproducible form.
  • nose, a framework for testing Python code.

Other packages

There are many more packages built on this stack – too many to list here. This is a brief overview of a few major ones:

  • Chaco is another Python plotting toolkit designed from the ground up to be great for embedded, interactive plotting. It is built on Traits, both are part of the Enthought Tool Suite.
  • Mayavi is a powerful and user-friendly framework for 3D visualization, built on top of the award winning Visualization Toolkit, VTK.
  • Cython extends Python syntax so that you can conveniently build C extensions, either to speed up critical code, or to integrate with C/C++ libraries.
  • Scikits are extra packages for more specific functionality. scikit-image and scikit-learn are two of the most prominent.
  • h5py and PyTables can both access data stored in the HDF5 format.

See the Topical Software page for more.

 

未必時宜的講︰

幾乎每個核心軟件都需要一本書之份量才能說得清楚,於是也只能請讀者自己找書來看,或是參考線上文件︰

Documentation

Documentation for core SciPy Stack projects:

The Getting Started page contains links to several good tutorials dealing with the SciPy stack.

 

借著導引指南嘗試摸索探究︰

Getting Started

This page is intended to help the beginner get a handle on SciPy and be productive with it as fast as possible.

What are NumPy, SciPy, matplotlib, …?

SciPy and friends can be used for a variety of tasks:

  • NumPy‘s array type augments the Python language with an efficient data structure useful for numerical work, e.g., manipulating matrices. NumPy also provides basic numerical routines, such as tools for finding eigenvectors.
  • SciPy contains additional routines needed in scientific work: for example, routines for computing integrals numerically, solving differential equations, optimization, and sparse matrices.
  • The matplotlib module produces high quality plots. With it you can turn your data or your models into figures for presentations or articles. No need to do the numerical work in one program, save the data, and plot it with another program.
  • Using IPython makes interactive work easy. Data processing, exploration of numerical models, trying out operations on-the-fly allows to go quickly from an idea to a result. See the IPython site for many examples.
  • There is a sizeable collection of both generic and application-specific numerical and scientific code, written using Python, NumPy and SciPy. Don’t reinvent the wheel, there may already be a pre-made solution for your problem. See Topical Software for a partial list.
  • As Python is a popular general-purpose programming language, it has many advanced modules for building for example interactive applications (see e.g. wxPython and Traits) or web sites (see e.g. Django). Using SciPy with these is a quick way to build a fully-fledged scientific application.

How to work with SciPy

Python is a programming language, and there are several ways to approach it. There is no single program that you can start and that gives an integrated user experience. Instead, there are several possible ways to work with Python.

The most common is to use the advanced interactive Python shell IPython to enter commands and run scripts. Scripts can be written with any text editor, for instance Emacs, Vim or even Notepad. Some of the packages such as Python(x,y) mentioned in Installing the SciPy Stack also offer an integrated scientific development environment.

Neither SciPy nor NumPy provide plotting functions. There are several plotting packages available for Python, the most commonly used one being matplotlib.

Learning to work with SciPy

To learn more about the Python language, the official Python tutorial is an excellent way to become familiar with the Python syntax and objects.

One way of getting a handle on the scientific computation tools in Python is to take a look at the following online resources:

In addition, a number of books have been written on numerical computation in Python, see for example a Google search on books related to SciPy.

 

自有一番樂趣乎??!!

pi@raspberrypi:~ $ ipython3 --pylab
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.
Using matplotlib backend: TkAgg

In [1]: from scipy import special, optimize

In [2]: f = lambda x: -special.jv(3, x)

In [3]: sol = optimize.minimize(f, 1.0)

In [4]: x = linspace(0, 10, 5000)

In [5]: x
Out[5]: 
array([  0.00000000e+00,   2.00040008e-03,   4.00080016e-03, ...,
         9.99599920e+00,   9.99799960e+00,   1.00000000e+01])

In [6]: plot(x, special.jv(3, x), '-', sol.x, -sol.fun, 'o')
Out[6]: 
[<matplotlib.lines.Line2D at 0x722c6470>,
 <matplotlib.lines.Line2D at 0x722c6650>]

In [7]: 

 

scipy-gs

 

 

 

 

 

 

 

 

 

 

 

 

 

 

光的世界︰派生科學計算六‧下

廬山東林寺三笑庭名聯‧清‧唐蝸寄

橋跨虎溪,三教三源流,三人三笑語;
蓮開僧舍,一花一世界,一葉一如來。

曾經三人三笑語,聞得虎嘯,恍然大悟。何故三詠三抒懷︰

詠二疏‧陶淵明

大象轉四時,功成者自去。
借問衰周來,幾人得其趣?
遊目漢廷中,二疏復此舉。
高嘯返舊居,長揖儲君傅。
餞送傾皇朝,華軒盈道路。
離別情所悲,余榮何足顧!
事勝感行人,賢哉豈常譽?
厭厭閭裏歡,所營非近務。
促席延故老,揮觴道平素。
問金終寄心,清言曉未悟。
放意樂餘年,遑恤身後慮。
誰雲其人亡,久而道彌著。

詠三良‧陶淵明

彈冠乘通津,但懼時我遺;
服勤盡歲月,常恐功愈微。
忠情謬獲露,遂為君所私。
出則陪文輿,入必侍丹帷;
箴規向已從,計議初無虧。
一朝長逝後,願言同此歸。
厚恩因難忘,君命安可違?
臨穴罔惟疑,投義誌攸希。
荊棘籠高墳,黃鳥聲正悲。
良人不可贖,泫然沾我衣。

詠荊軻‧陶淵明

燕丹善養士,誌在報強嬴。
招集百夫良,歲暮得荊卿。
君子死知己,提劍出燕京;
素驥鳴廣陌,慷慨送我行。
雄發指危冠,猛氣衝長纓。
飲餞易水上,四座列群英。
漸離擊悲筑,宋意唱高聲。
蕭蕭哀風逝,淡淡寒波生。
商音更流涕,羽奏壯士驚。
心知去不歸,且有後世名。
登車何時顧,飛蓋入秦庭。
淩厲越萬裏,逶迤過千城。
圖窮事自至,豪主正怔營。
惜哉劍術疏,奇功遂不成!
其人雖已沒,千載有餘情。

晉時淵明,晉後名潛,已棄五斗米,不知姓字忘其何人,五柳先生『伍』『柳』吟誦耶??果真二三子其志一也!!雖說是移時隔空得失不同,其人其心何其相似乎??!!先生『菀柳』之『情』仍一樣吧!!??

誰雲其人亡,久而道彌著。

良人不可贖,泫然沾我衣。

其人雖已沒,千載有餘情。

大暑已過,入秋之際,講此『春耕夏耘』之『心法』勒。古今中外『學問』縱有千百種,談起功夫『心法』則一矣。往往其『志一』其『人同』也!!只是『一花』『一葉』真誠對待歟??

如果天地公平,天理能隨觀者變乎??故知物理學之所以著意於

仿射變換性質了!!

一仿射變換保留了:

  1. 點之間的共線性,例如通過同一線之點 (即稱為共線點)在變換後仍呈共線。
  2. 向量沿著一線的比例,例如對相異共線三點 p_{1},\,p_{2},\,p_{3}, \overrightarrow {p_{1}p_{2}}\overrightarrow {p_{2}p_{3}}的比例同於 \overrightarrow {f(p_{1})f(p_{2})}  \overrightarrow {f(p_{2})f(p_{3})}
  3. 帶不同質量的點之質心

一仿射變換為可逆的若且唯若A為可逆的。在矩陣表示中,其反元素為

{\begin{bmatrix}A^{{-1}}&-A^{{-1}}{\vec {b}}\ \\0,\ldots ,0&1\end{bmatrix}}

可逆仿射變換組成仿射群,其中包含具n階的一般線性群為子群,且自身亦為一n+1階的一般線性群之子群。 當A為常數乘以正交矩陣時,此子集合構成一子群,稱之為相似變換舉例而言,假如仿射變換於一平面上且假如A之行列式為1或-1,那麼該變換即為等面積變換。此類變換組成一稱為等仿射群的子集。一同時為等面積變換與相似變換之變換,即為一平面上保持歐幾里德距離不變之保距映射 這些群都有一保留了原定向的子群,也就是其對應之A的行列式大於零。在最後一例中,即為三維中剛體運動之群(旋轉加平移)。 假如有一不動點,我們可以將其當成原點,則仿射變換被縮還到一線性變換。這使得變換更易於分類與理解。舉例而言,將一變換敘述為特定軸的旋轉,相較於將其形容為平移與旋轉的結合,更能提供變換行為清楚的解釋。只是,這取決於應用與內容。

 

若知『平移』與『旋轉』為『保距映射』,餘理可知矣︰

※矩陣乘法不具『交換性』,正是『平移』後『旋轉』往往不等於『旋轉』再『平移』也。

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]: xα, yα, xβ, yβ, Tx, Ty, θ = symbols('xα, yα, xβ, yβ, Tx, Ty, θ')  In [4]: T = Matrix([[1, 0, Tx], [0, 1, Ty], [0, 0, 1]])  In [5]: T Out[5]:  ⎡1  0  Tx⎤ ⎢        ⎥ ⎢0  1  Ty⎥ ⎢        ⎥ ⎣0  0  1 ⎦  In [6]: T.det() Out[6]: 1  In [7]: R = Matrix([[cos(θ), sin(θ), 0], [-sin(θ), cos(θ), 0], [0, 0, 1]])  In [8]: R Out[8]:  ⎡cos(θ)   sin(θ)  0⎤ ⎢                  ⎥ ⎢-sin(θ)  cos(θ)  0⎥ ⎢                  ⎥ ⎣   0       0     1⎦  In [9]: R.det() Out[9]:     2         2    sin (θ) + cos (θ)  In [10]: R.det().simplify() Out[10]: 1  In [11]: α平移 = T * Matrix([xα, yα, 1])  In [12]: α平移 Out[12]:  ⎡Tx + xα⎤ ⎢       ⎥ ⎢Ty + yα⎥ ⎢       ⎥ ⎣   1   ⎦  In [13]: β平移 = T * Matrix([xβ, yβ, 1])  In [14]:  β平移 Out[14]:  ⎡Tx + xβ⎤ ⎢       ⎥ ⎢Ty + yβ⎥ ⎢       ⎥ ⎣   1   ⎦  In [15]: αβ平移距離 = (α平移[0] - β平移[0])** 2 + (α平移[1] - β平移[1])** 2  In [16]: αβ平移距離 Out[16]:           2            2 (xα - xβ)  + (yα - yβ)   In [17]: α旋轉 = R * Matrix([xα, yα, 1])  In [18]: α旋轉 Out[18]:  ⎡xα⋅cos(θ) + yα⋅sin(θ) ⎤ ⎢                      ⎥ ⎢-xα⋅sin(θ) + yα⋅cos(θ)⎥ ⎢                      ⎥ ⎣          1           ⎦  In [19]: β旋轉 = R * Matrix([xβ, yβ, 1])  In [20]: β旋轉 Out[20]:  ⎡xβ⋅cos(θ) + yβ⋅sin(θ) ⎤ ⎢                      ⎥ ⎢-xβ⋅sin(θ) + yβ⋅cos(θ)⎥ ⎢                      ⎥ ⎣          1           ⎦  In [21]: αβ旋轉距離 = (α旋轉[0] - β旋轉[0])** 2 + (α旋轉[1] - β旋轉[1])** 2  In [22]: αβ旋轉距離 Out[22]:                                                  2                              (-xα⋅sin(θ) + xβ⋅sin(θ) + yα⋅cos(θ) - yβ⋅cos(θ))  + (xα⋅cos(θ) - xβ⋅cos(θ) + y                       2 α⋅sin(θ) - yβ⋅sin(θ))   In [23]: αβ旋轉距離.expand().simplify() Out[23]:    2               2     2               2 xα  - 2⋅xα⋅xβ + xβ  + yα  - 2⋅yα⋅yβ + yβ   In [24]: R*T Out[24]:  ⎡cos(θ)   sin(θ)  Tx⋅cos(θ) + Ty⋅sin(θ) ⎤ ⎢                                       ⎥ ⎢-sin(θ)  cos(θ)  -Tx⋅sin(θ) + Ty⋅cos(θ)⎥ ⎢                                       ⎥ ⎣   0       0               1           ⎦  In [25]: T*R Out[25]:  ⎡cos(θ)   sin(θ)  Tx⎤ ⎢                   ⎥ ⎢-sin(θ)  cos(θ)  Ty⎥ ⎢                   ⎥ ⎣   0       0     1 ⎦  In [26]:  </pre>    <span style="color: #003300;">光有『心法』,缺少『運用』之實務修煉,功夫怕也不踏實。在此祇以『相似幾何』之理</span> <h1 id="firstHeading" class="firstHeading" lang="en"><span style="color: #003300;"><a style="color: #003300;" href="https://en.wikipedia.org/wiki/Similarity_%28geometry%29">Similarity (geometry)</a></span></h1> <span style="color: #808080;">Two geometrical objects are called <b>similar</b> if they both have the same <a style="color: #808080;" title="Shape" href="https://en.wikipedia.org/wiki/Shape">shape</a>, or one has the same shape as the mirror image of the other. More precisely, one can be obtained from the other by uniformly <a style="color: #808080;" title="Scaling (geometry)" href="https://en.wikipedia.org/wiki/Scaling_%28geometry%29">scaling</a> (enlarging or shrinking), possibly with additional <a style="color: #808080;" title="Translation (geometry)" href="https://en.wikipedia.org/wiki/Translation_%28geometry%29">translation</a>, <a style="color: #808080;" title="Rotation (mathematics)" href="https://en.wikipedia.org/wiki/Rotation_%28mathematics%29">rotation</a> and <a style="color: #808080;" title="Reflection (mathematics)" href="https://en.wikipedia.org/wiki/Reflection_%28mathematics%29">reflection</a>. This means that either object can be rescaled, repositioned, and reflected, so as to coincide precisely with the other object. If two objects are similar, each is <a style="color: #808080;" title="Congruence (geometry)" href="https://en.wikipedia.org/wiki/Congruence_%28geometry%29">congruent</a> to the result of a particular uniform scaling of the other. A modern and novel perspective of similarity is to consider geometrical objects similar if one appears congruent to the other when zoomed in or out at some level.</span>  <span style="color: #808080;">For example, all <a style="color: #808080;" title="Circle" href="https://en.wikipedia.org/wiki/Circle">circles</a> are similar to each other, all <a class="mw-redirect" style="color: #808080;" title="Square (geometry)" href="https://en.wikipedia.org/wiki/Square_%28geometry%29">squares</a> are similar to each other, and all <a class="mw-redirect" style="color: #808080;" title="Equilateral triangles" href="https://en.wikipedia.org/wiki/Equilateral_triangles">equilateral triangles</a> are similar to each other. On the other hand, <a style="color: #808080;" title="Ellipse" href="https://en.wikipedia.org/wiki/Ellipse">ellipses</a> are <i>not</i> all similar to each other, <a class="mw-redirect" style="color: #808080;" title="Rectangles" href="https://en.wikipedia.org/wiki/Rectangles">rectangles</a> are not all similar to each other, and <a style="color: #808080;" title="Isosceles triangle" href="https://en.wikipedia.org/wiki/Isosceles_triangle">isosceles triangles</a> are not all similar to each other.</span>  <span style="color: #808080;">If two angles of a triangle have measures equal to the measures of two angles of another triangle, then the triangles are similar. Corresponding sides of similar polygons are in proportion, and corresponding angles of similar polygons have the same measure.</span>  <span style="color: #808080;">This article assumes that a scaling can have a scale factor of 1, so that all congruent shapes are also similar, but some school text books specifically exclude congruent triangles from their definition of similar triangles by insisting that the sizes must be different if the triangles are to qualify as similar.</span>  <img class="alignnone size-full wp-image-56737" src="http://www.freesandal.org/wp-content/uploads/300px-Similar-geometric-shapes.svg.png" alt="300px-Similar-geometric-shapes.svg" width="300" height="208" />  <span style="color: #808080;">Figures shown in the same color are similar</span>     <span style="color: #003300;">介紹一下『skimage』程式庫</span>  <img class="alignnone size-full wp-image-56740" src="http://www.freesandal.org/wp-content/uploads/skimagelogo.png" alt="skimagelogo" width="568" height="140" /> <div class="well hero row-fluid summary-box container"> <h2><span style="color: #808080;"><a style="color: #808080;" href="http://scikit-image.org/">Image processing in Python</a></span></h2> <span style="color: #808080;"><em>scikit-image</em> is a collection of algorithms for image processing. It is available <a class="reference external" style="color: #808080;" href="http://scikit-image.org/docs/dev/license.html">free of charge and free of restriction</a>. We pride ourselves on high-quality, peer-reviewed code, written by an active <a class="reference external" style="color: #808080;" href="https://www.ohloh.net/p/scikit-image/contributors">community of volunteers</a>.</span>  <span style="color: #808080;"><a class="btn btn-warning clearfix" style="color: #808080;" href="http://scikit-image.org/download"> <i class="icon-download icon-white"></i>Download</a></span>  </div> <div id="getting-started" class="section"> <h1><span style="color: #808080;">Getting Started</span></h1> <span style="color: #808080;">Filtering an image with <code class="docutils literal"><span class="pre">scikit-image</span></code> is easy! For more examples, please visit our <a class="reference external" style="color: #808080;" href="http://scikit-image.org/docs/dev/auto_examples">gallery</a>.</span> <pre class="lang:python decode:true ">from skimage import data, io, filters  image = data.coins() # or any NumPy array! edges = filters.sobel(image) io.imshow(edges) io.show() </pre> <div class="row-fluid container"> <div class="well span6 container"><img class="coins-sample span6" src="http://scikit-image.org/_images/coins-small.png" alt="_images/coins-small.png" /> <img class="coins-sample span6" src="http://scikit-image.org/_images/sobel-coins-small.png" alt="_images/sobel-coins-small.png" /></div> </div> <div class="well hero row-fluid summary-box citation container">  <span style="color: #808080;"><b>If you find this project useful, please cite:</b> [<a style="color: #808080;" href="http://scikit-image.org/_static/skimage.bib">BiBTeX</a>]</span>  <span style="color: #808080;">Stéfan van der Walt, Johannes L. Schönberger, Juan Nunez-Iglesias, François Boulogne, Joshua D. Warner, Neil Yager, Emmanuelle Gouillart, Tony Yu and the scikit-image contributors. <b>scikit-image: Image processing in Python</b>. PeerJ 2:e453 (2014) <a style="color: #808080;" href="http://dx.doi.org/10.7717/peerj.453"> http://dx.doi.org/10.7717/peerj.453 </a></span>  </div> </div>    <span style="color: #003300;">在二維圖像上的應用,且當個門徑吧。</span>  <span style="color: #808080;">【參考資料】</span>  <span style="color: #808080;">‧ <a style="color: #808080;" href="http://scikit-image.org/docs/dev/auto_examples/applications/plot_geometric.html">Using geometric transformations</a></span>  <span style="color: #808080;">‧ <a style="color: #808080;" href="http://scikit-image.org/docs/dev/api/skimage.transform.html">Module: transform</a></span>  <span style="color: #808080;">‧ <a style="color: #808080;" href="http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4081273/">scikit-image: image processing in Python</a></span>  <span style="color: #808080;">‧ <a style="color: #808080;" href="http://www.scipy-lectures.org/packages/scikit-image/">Scikit-image: image processing</a></span>     <span style="color: #003300;">讀者切莫因五行程式範例文字儼然『校對有誤』就止步!</span> <pre class="lang:python decode:true">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 skimage import data, io, filter

In [2]: image = data.coins()

In [3]: edges = filter.sobel(image)

In [4]: io.imshow(edges)

In [5]: io.show()

In [6]: io.imshow(image)

In [7]: io.show()

In [8]: 文本 = data.text()

 

skimage_filter_1

 

skimage_filter_2

 

須知積極更新發展快速之程式庫,文件往往可能『前差後異』也?

In [9]: from skimage import transform as tf

In [10]: 旋轉文本 = tf.rotate(文本, 45, resize=True)

In [11]: io.imshow(文本)

In [12]: io.show()

In [13]: io.imshow(旋轉文本)

In [14]: io.show()

In [15]: import math

In [16]: 相似變換 = tf.SimilarityTransform( rotation=math.pi / 4, translation=( 文本.sape[0] / 2, -100))

In [17]: 相似變換文本 = tf.warp(文本, 相似變換)

In [18]: io.imshow(相似變換文本)

In [19]: io.show()

In [20]: 

 

skimage_文本

 

skimage_文本旋轉

 

skimage_文本相似變換

 

難到山不會轉,竟然路也不能轉耶??!!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

光的世界︰派生科學計算六‧中

歐式幾何裡並無『座標系』之概念,而是以『全等』關係︰

Congruence (geometry)

In geometry, two figures or objects are congruent if they have the same shape and size, or if one has the same shape and size as the mirror image of the other.[1]

More formally, two sets of points are called congruent if, and only if, one can be transformed into the other by an isometry, i.e., a combination of rigid motions, namely a translation, a rotation, and a reflection. This means that either object can be repositioned and reflected (but not resized) so as to coincide precisely with the other object. So two distinct plane figures on a piece of paper are congruent if we can cut them out and then match them up completely. Turning the paper over is permitted.

In elementary geometry the word congruent is often used as follows.[2] The word equal is often used in place of congruent for these objects.

  • Two line segments are congruent if they have the same length.
  • Two angles are congruent if they have the same measure.
  • Two circles are congruent if they have the same diameter.

In this sense, two plane figures are congruent implies that their corresponding characteristics are “congruent” or “equal” including not just their corresponding sides and angles, but also their corresponding diagonals, perimeters and areas.

The related concept of similarity applies if the objects differ in size but not in shape.

Congruent_non-congruent_triangles.svg

An example of congruence. The two triangles on the left are congruent, while the third is similar to them. The last triangle is neither similar nor congruent to any of the others. Note that congruence permits alteration of some properties, such as location and orientation, but leaves others unchanged, like distance and angles. The unchanged properties are called invariants.

 

研究各類圖形具有種種性質之『不變性』。

參照之前文本所說︰

……

從物理上講,那個三角形就是『剛體』 rigid body ,它在『運動』中保持『形狀』的『不變性』。而且不同觀察者間的『座標變換』可以用

Rigid transformation

In mathematics, a rigid transformation (isometry) of a vector space preserves distances between every pair of points.[1][2] Rigid transformations of the plane R2, space R3, or real n-dimensional space Rn are termed a Euclidean transformation because they form the basis of Euclidean geometry.[3]

The rigid transformations include rotations, translations, reflections, or their combination. Sometimes reflections are excluded from the definition of a rigid transformation by imposing that the transformation also preserve the handedness of figures in the Euclidean space (a reflection would not preserve handedness; for instance, it would transform a left hand into a right hand). To avoid ambiguity, this smaller class of transformations is known as proper rigid transformations (informally, also known as roto-translations). In general, any proper rigid transformation can be decomposed as a rotation followed by a translation, while any rigid transformation can be decomposed as an improper rotation followed by a translation (or as a sequence of reflections).

Any object will keep the same shape and size after a proper rigid transformation.

All rigid transformations are examples of affine transformations. The set of all (proper and improper) rigid transformations is a group called the Euclidean group, denoted E(n) for n-dimensional Euclidean spaces. The set of proper rigid transformation is called special Euclidean group, denoted SE(n).

In kinematics, proper rigid transformations in a 3-dimensional Euclidean space, denoted SE(3), are used to represent the linear and angular displacement of rigid bodies. According to Chasles’ theorem, every rigid transformation can be expressed as a screw displacement.

Formal definition

A rigid transformation is formally defined as a transformation that, when acting on any vector v, produces a transformed vector T(v) of the form

T(v) = R v + t

where RT = R−1 (i.e., R is an orthogonal transformation), and t is a vector giving the translation of the origin.

A proper rigid transformation has, in addition,

det(R) = 1

which means that R does not produce a reflection, and hence it represents a rotation (an orientation-preserving orthogonal transformation). Indeed, when an orthogonal transformation matrix produces a reflection, its determinant is –1.

Distance formula

A measure of distance between points, or metric, is needed in order to confirm that a transformation is rigid. The Euclidean distance formula for Rn is the generalization of the Pythagorean theorem. The formula gives the distance squared between two points X and Y as the sum of the squares of the distances along the coordinate axes, that is

 d(\mathbf{X},\mathbf{Y})^2 = (X_1-Y_1)^2 + (X_2-Y_2)^2 + \ldots + (X_n-Y_n)^2 = (\mathbf{X}-\mathbf{Y})\cdot(\mathbf{X}-\mathbf{Y}).

where X=(X1, X2, …, Xn) and Y=(Y1, Y2, …, Yn), and the dot denotes the scalar product.

Using this distance formula, a rigid transformation g:Rn→Rn has the property,

d(g(\mathbf{X}), g(\mathbf{Y}))^2 = d(\mathbf{X}, \mathbf{Y})^2.

─── 摘自《勇闖新世界︰ W!o《卡夫卡村》變形祭︰品味科學‧教具教材‧【專題】 PD‧箱子世界‧留白

 

如果依據伽利略『相對性』原理之視角,那麼物理性質也不該因為『觀察者』或『座標系』之不同而有所改變??因是古典力學就得符合『伽利略變換』矣!!

Galilean transformation

In physics, a Galilean transformation is used to transform between the coordinates of two reference frames which differ only by constant relative motion within the constructs of Newtonian physics. These transformations together with spatial rotations and translations in space and time form the inhomogeneous Galilean group (assumed throughout below). Without the translations in space and time the group is the homogeneous Galilean group. The Galilean group is the group of motions of Galilean relativity action on the four dimensions of space and time, forming the Galilean geometry. This is the passive transformation point of view. The equations below, although apparently obvious, are valid only at speeds much less than the speed of light. In special relativity the Galilean transformations are replaced by Poincaré transformations; conversely, the group contraction in the classical limit c → ∞ of Poincaré transformations yields Galilean transformations.

Galileo formulated these concepts in his description of uniform motion.[1] The topic was motivated by his description of the motion of a ball rolling down a ramp, by which he measured the numerical value for the acceleration of gravity near the surface of the Earth.

300px-Standard_conf

Standard configuration of coordinate systems for Galilean transformations.

 

只是通常各自有『原點』的『座標系』並不方便以『矩陣』來表達『時空』之『等距同構

Isometry

In mathematics, an isometry (or congruence, or congruent transformation) is a distance-preserving injective map between metric spaces.[1]

Introduction

Given a metric space (loosely, a set and a scheme for assigning distances between elements of the set), an isometry is a transformation which maps elements to the same or another metric space such that the distance between the image elements in the new metric space is equal to the distance between the elements in the original metric space. In a two-dimensional or three-dimensional Euclidean space, two geometric figures are congruent if they are related by an isometry;[3] the isometry that relates them is either a rigid motion (translation or rotation), or a composition of a rigid motion and a reflection.

Isometries are often used in constructions where one space is embedded in another space. For instance, the completion of a metric space M involves an isometry from M into M’, a quotient set of the space of Cauchy sequences on M. The original space M is thus isometrically isomorphic to a subspace of a complete metric space, and it is usually identified with this subspace. Other embedding constructions show that every metric space is isometrically isomorphic to a closed subset of some normed vector space and that every complete metric space is isometrically isomorphic to a closed subset of some Banach space.

An isometric surjective linear operator on a Hilbert space is called a unitary operator.

Academ_Reflections_with_parallel_axis_on_wallpaper.svg

A composition of two opposite isometries is a direct isometry. A reflection in a line is an opposite isometry, like R 1 or R 2 on the image. Translation T is a direct isometry: a rigid motion.[2]

 

的變換性質,因此借著

齊次坐標

數學裡,齊次坐標(homogeneous coordinates),或投影坐標(projective coordinates)是指一個用於投影幾何裡的坐標系統,如同用於歐氏幾何裡的笛卡兒坐標一般。該詞由奧古斯特·費迪南德·莫比烏斯於1827年在其著作《Der barycentrische Calcul》一書內引入[1][2]。齊次坐標可讓包括無窮遠點的點坐標以有限坐標表示。使用齊次坐標的公式通常會比用笛卡兒坐標表示更為簡單,且更為對稱 。齊次坐標有著廣泛的應用,包括電腦圖形及3D電腦視覺。使用齊次坐標可讓電腦進行仿射變換,並通常,其投影變換能簡單地使用矩陣來表示。

如一個點的齊次坐標乘上一個非零純量,則所得之坐標會表示同一個點。因為齊次坐標也用來表示無窮遠點,為此一擴展而需用來標示坐標之數值比投影空間之維度多一。例如,在齊次坐標裡,需要兩個值來表示在投影線上的一點,需要三個值來表示投影平面上的一點。

600px-RationalBezier2D.svg

有理貝茲曲線-定義於齊次坐標內的多項式曲線(藍色),以及於平面上的投影-有理曲線(紅色)

 

來統整論述也就自然而然的了??!!更別說由於雙眼之視覺現象還得走入『仿射變換』的哩!!??

 

2D_affine_transformation_matrix.svg

 

 

 

 

 

 

 

 

 

 

 

 

 

輕。鬆。學。部落客