L4K ︰小海龜繪圖《III》

小海龜之『狀態』 state 可由『位置』 position (xcor , ycor) 以及它的『朝向』 heading \vec{\theta} 角度所確定。在 Turtle Art 裡有一個『print』指令,能用來探究這個『狀態』的數值表示。

turtle-art-right-xcor-of-right-of-screen

 

因此我們可以知道『起始位置』位於畫布中央 (0, 0) ,且以 top, bottom, left, right 定出畫布大小。『朝向』是以『向上』為零度 0^{\circ} ,『向右』 順時鐘增至 {360}^{\circ} 。『向左』旋轉 \theta 角之方向,表示為 {360}^{\circ} - \theta

假設 S = [\vec{r} = (xcor , ycor) , \vec{\theta}] 是某一時刻小海龜之『狀態』, forward  dright  \vec{\alpha}left  \vec{\beta} ,將小海龜之『狀態』改變為 S^{'} = [\vec{r^{'}} = ({xcor}^{'} , {ycor}^{'}) , \vec{ {\theta}^{'}}] ,那麼 SS^{'} 間,會滿足如下的關係式︰

forward d

\vec{r^{'}} - \vec{r} = d \cdot \vec{\theta}

\vec{{\theta}^{'}} = \vec{\theta}

 

right \vec{\alpha}

\vec{r^{'}} - \vec{r} = \vec{0}

\vec{{\theta}^{'}} = \vec{\theta} + \vec{\alpha}

 

left \vec{\beta}

\vec{r^{'}} - \vec{r} = \vec{0}

\vec{{\theta}^{'}} = \vec{\theta} - \vec{\beta}

※ 註︰為簡化起見,角度計算未寫出 mod \ 360 以及負數需加上  360

 

不知是否足已彰顯小海龜『幾何學』之『仿射性』??

仿射幾何學

幾何上,仿射幾何是不涉及任何原點、長度或者角度概念的幾何 ,但是有兩點相減得到一個向量的概念。

它位於歐氏幾何射影幾何之間。它是在域 K 上任意維仿射空間的幾何。 K 為實數域的情況所包含的內容足夠使人了解其大部分思想 。

Affine geometry

In mathematics, affine geometry is what remains of Euclidean geometry, when not using (mathematicians often say “when forgetting”) the metric notions of distance and angle. As the notion of parallel lines is one of the main properties that is independent of any metric, affine geometry is often considered as the study of parallel lines. Therefore, Playfair’s axiom (given a line L and a point P not on L, there is exactly one line parallel to L that passes through P) is fundamental in affine geometry. Comparisons of figures in affine geometry are made with affine transformations, which are mappings that preserve alignment of points and parallelism of lines.

Affine geometry can be developed in two ways that are essentially equivalent.[1]

In synthetic geometry, an affine space is a set of points to which is associated a set of lines, which satisfy some axioms (such as Playfair’s axiom).

Affine geometry can also be developed on the basis of linear algebra. In this context an affine space is a set of points equipped with a set of transformations (that is bijective mappings), the translations, which forms a vector space (over a given field, commonly the real numbers), and such that for any given ordered pair of points there is a unique translation sending the first point to the second; the composition of two translations is their sum in the vector space of the translations.

In more concrete terms, this amounts to having an operation that associates to any ordered pair of points a vector and another operation that allows translation of a point by a vector to give another point; these operations are required to satisfy a number of axioms (notably that two successive translations have the effect of translation by the sum vector). By choosing any point as “origin”, the points are in one-to-one correspondence with the vectors, but there is no preferred choice for the origin; thus an affine space may be viewed as obtained from its associated vector space by “forgetting” the origin (zero vector).

Although this article only discusses affine spaces, the notion of “forgetting the metric” is much more general, and can be applied to arbitrary manifolds, in general. This extension of the notion of affine spaces to manifolds in general is developed in the article on the affine connection.

220px-translation_parallelogram-svg

In affine geometry, one uses Playfair’s axiom to find the line through C1 and parallel to B1B2, and to find the line through B2 and parallel to B1C1: their intersection C2 is the result of the indicated translation.

 

『向前』 forward 是『平移』,改變『位置』,不改變『朝向』;『向右』 right 、『向左』 left 是『旋轉』,改變『朝向』,不改變『位置』,唯參照『當下狀態』而施為的也!!