L4K ︰ Python Turtle《五》

『物理現象』不因觀察者『座標系』之選擇而改變。『幾何圖形』之『性質』不受解析者『座標系』之使用而不同。正所以小海龜的幾何學較接近『運動版』之『歐氏幾何學』,反倒不像是笛卡爾的『解析幾何』的了。因此『畫方』

>>> def square():
… for repeat in range(4):
… turtle.forward(100)
… turtle.right(90)

python-turtle-graphics

 

『畫圓』

>>> def 圓周運動():
… for 重複 in range(360):
… turtle.forward(1)
… turtle.right(1)

python-turtle-graphics_%e5%9c%93%e5%91%a8%e9%81%8b%e5%8b%95

 

之『程序』 procedures ,無論小海龜『朝向』 heading 為何,皆是『一樣』的乎!假使從『軌跡』方面考察,一點 P_t 到下一點 P_{t + \delta t} 之『向量』,只是由 P_t 點之『朝向』,加以『旋轉』、『平移』而成,故為『鄰域』施為也,要是將之用於『曲面』亦相似的哩?如是或可通『參數方程式』之好處的耶!! ??

Parametric equation

In mathematics, parametric equations define a group of quantities as functions of one or more independent variables called parameters.[1] Parametric equations are commonly used to express the coordinates of the points that make up a geometric object such as a curve or surface, in which case the equations are collectively called a parametric representation or parameterization of the object.[2][3] For example, the equations

{\begin{aligned}x&=\cos t\\y&=\sin t\end{aligned}}

form a parametric representation of the unit circle, where t is the parameter.

In addition to curves and surfaces, parametric equations can describe manifolds and algebraic varieties of higher dimension, with the number of parameters being equal to the dimension of the manifold or variety, and the number of equations being equal to the dimension of the space in which the manifold or variety is considered (for curves the dimension is one and one parameter is used, for surfaces dimension two and two parameters, etc.).

Parametric equations are commonly used in kinematics, where the trajectory of an object is represented by equations depending on time as the parameter. Because of this application, a single parameter is often labeled t; however, parameters can represent other physical quantities (such as geometric variables) or can be selected arbitrarily for convenience. Parameterizations are non-unique; more than one set of parametric equations can specify the same curve.[4]

butterfly_trans01-svg

The butterfly curve can be defined by parametric equations of x and y.

Applications

Kinematics

In kinematics, objects’ paths through space are commonly described as parametric curves, with each spatial coordinate depending explicitly on an independent parameter (usually time). Used in this way, the set of parametric equations for the object’s coordinates collectively constitute a vector-valued function for position. Such parametric curves can then be integrated and differentiated termwise. Thus, if a particle’s position is described parametrically as

{\displaystyle r(t)=(x(t),y(t),z(t))}

then its velocity can be found as

{\displaystyle v(t)=r'(t)=(x'(t),y'(t),z'(t))}

and its acceleration as

{\displaystyle a(t)=r''(t)=(x''(t),y''(t),z''(t))}.

Computer-aided design

Another important use of parametric equations is in the field of computer-aided design (CAD).[5] For example, consider the following three representations, all of which are commonly used to describe planar curves.

Type Form Example Description
1. Explicit y=f(x)\,\! y=mx+b\,\! Line
2. Implicit f(x,y)=0\,\! \left(x-a\right)^{2}+\left(y-b\right)^{2}=r^{2} Circle
3. Parametric x={\frac {x(t)}{w(t)}}; y={\frac {y(t)}{w(t)}} x=a_{0}+a_{1}t;\,\!y=b_{0}+b_{1}t\,\!
x=a+r\,\cos t;\,\! y=b+r\,\sin t\,\!
Line

Circle

The first two types are known as analytic, or non-parametric, representations of curves; when compared to parametric representations for use in CAD applications, non-parametric representations have shortcomings. In particular, the non-parametric representation depends on the choice of the coordinate system and does not lend itself well to geometric transformations, such as rotations, translations, and scaling; non-parametric representations therefore make it more difficult to generate points on a curve. These problems can be addressed by rewriting the non-parametric equations in parametric form.[6]