據說小海龜『參圓格物』多時,終於發現『直達』 goto 和『轉向』 turn 的匯通處。由於言之未詳史無所載,此刻強為解說,難免生吞活剝也 。簡言之︰畫圓之理,『曲率』處處均一,故而重複進一步 forward 1 恆向 轉一度 right 1 【※ or left 1 】可以擬 ○ 矣。
Curvature
In mathematics, curvature is any of a number of loosely related concepts in different areas of geometry. Intuitively, curvature is the amount by which a geometric object such as a surface deviates from being a flat plane, or a curve from being straight as in the case of a line, but this is defined in different ways depending on the context. There is a key distinction between extrinsic curvature, which is defined for objects embedded in another space (usually a Euclidean space) – in a way that relates to the radius of curvature of circles that touch the object – and intrinsic curvature, which is defined in terms of the lengths of curves within a Riemannian manifold.
This article deals primarily with extrinsic curvature. Its canonical example is that of a circle, which has a curvature equal to the reciprocal of its radius everywhere. Smaller circles bend more sharply, and hence have higher curvature. The curvature of a smooth curve is defined as the curvature of its osculating circle at each point.
Curvature is normally a scalar quantity, but one may also define a curvature vector that takes into account the direction of the bend in addition to its magnitude. The curvature of more complex objects (such as surfaces or even curved n-dimensional spaces) is described by more complex objects from linear algebra, such as the general Riemann curvature tensor.
This article sketches the mathematical framework which describes the curvature of a curve embedded in a plane and the curvature of a surface in Euclidean space.
Precise definition
Suppose that C is a twice continuously differentiable immersed plane curve, which here means that there exists a parametric representation of C by a pair of functions γ(t) = (x(t), y(t)) such that the first and second derivatives of x and y both exist and are continuous, and
throughout the domain. For such a plane curve, there exists a reparametrization with respect to arc length s. This is a parametrization of C such that
The velocity vector T(s) is the unit tangent vector. The unit normal vector N(s), the curvature κ(s), the oriented or signed curvature k(s), and the radius of curvature R(s) are given by
Expressions for calculating the curvature in arbitrary coordinate systems are given below.
Animations of the signed curvature and the acceleration vector T′(s)
Signed curvature
The sign of the signed curvature k indicates the direction in which the unit tangent vector rotates as a function of the parameter along the curve. If the unit tangent rotates counterclockwise, then k > 0. If it rotates clockwise, then k < 0. So, for example, the sign of the curvature of a graph is the same as the sign of the second derivative (see below).
The signed curvature depends on the particular parametrization chosen for a curve. For example, the unit circle can be parametrised by (cos θ, sin θ) (counterclockwise, with k > 0), or by (cos(−θ), sin(−θ)) (clockwise, with k < 0). More precisely, the signed curvature depends only on the choice of orientation of an immersed curve. Every immersed curve in the plane admits two possible orientations.
Local expressions
For a plane curve given parametrically in Cartesian coordinates as γ(t) = (x(t),y(t)), the curvature is
where primes refer to derivatives d⁄dt with respect to the parameter t. The signed curvature k is
The expression reflects the geometric meaning discussed above, that the curvature is influenced by the change amount of the tangent vector in the direction of the normal vector, as
These can be expressed in a coordinate-independent manner via
然而『朝向』與『轉向角度』之計算,於 及 時︰
pi@raspberrypi:~ python3 Python 3.4.2 (default, Oct 19 2014, 13:31:11) [GCC 4.9.1] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import turtle, math >>> turtle.setup(width=1024, height=768) >>> turtle.shape('turtle') >>> turtle.mode('logo') >>> >>> t = [math.pi/180*n for n in range(361)] >>> xc = [100*math.sin(t[n]) for n in range(361)] >>> yc = [100*math.cos(t[n]) for n in range(361)] >>> 點距 = [math.sqrt( (yc[n+1]-yc[n])**2 + (xc[n+1]-xc[n])**2 ) for n in range(360)] >>> 朝向 = [90 - 180.0/math.pi*math.atan( (yc[n+1]-yc[n])/(xc[n+1]-xc[n]) ) for n in range(360)] >>> 轉向角度 = [朝向[n+1]-朝向[n] for n in range(359)] >>> >>> 朝向[88:92] [178.49999999999972, 179.5000000000002, 0.49999999999980105, 1.5000000000002984] >>> 朝向[268:272] [178.4999999999997, 179.50000000000017, 0.49999999999981526, 1.5000000000002416] >>> 轉向角度[88:91] [1.0000000000004832, -179.0000000000004, 1.0000000000004974] >>> 轉向角度[268:271] [1.0000000000004832, -179.00000000000034, 1.0000000000004263] >>> >>> 起始角度 = 朝向[0] >>> 第一步長度 = 點距[0] >>> 餘步列 = 點距[1:] >>> >>> 轉向角度[89] = 轉向角度[88] >>> 轉向角度[269] = 轉向角度[268] >>> 轉向角度[88:91] [1.0000000000004832, 1.0000000000004832, 1.0000000000004974] >>> 轉向角度[268:271] [1.0000000000004832, 1.0000000000004832, 1.0000000000004263] >>> >>> def 畫圓(): ... 保存原向 = turtle.heading() ... turtle.right(起始角度) ... turtle.forward(第一步長度) ... for n in range(359): ... if 轉向角度[n] > 0: ... turtle.right(轉向角度[n]) ... else: ... turtle.left(-轉向角度[n]) ... turtle.forward(餘步列[n]) ... turtle.seth(保存原向) ... >>> 畫圓() >>> >>> x = [80*math.sin(t[n])**3 for n in range(361)] >>> y = [65*math.cos(t[n])- 25*math.cos(2*t[n])-10*math.cos(3*t[n])-5*math.cos(4*t[n]) for n in range(361)] >>> 點距 = [math.sqrt( (y[n+1]-y[n])**2 + (x[n+1]-x[n])**2 ) for n in range(360)] >>> 朝向 = [90 - 180.0/math.pi*math.atan( (y[n+1]-y[n])/(x[n+1]-x[n]) ) for n in range(360)] >>> 轉向角度 = [朝向[n+1]-朝向[n] for n in range(359)] >>> 轉向角度[88:91] [2.541118754282593, -177.4740814826926, 2.5038729840123324] >>> 轉向角度[268:271] [2.503872984012361, -177.47408148269255, 2.5411187542823797] >>> 轉向角度[89] = 轉向角度[88] >>> 轉向角度[269] = 轉向角度[268] >>> >>> def 知心(): ... 保存原向 = turtle.heading() ... turtle.right(起始角度) ... turtle.forward(第一步長度) ... for n in range(359): ... if 轉向角度[n] > 0: ... turtle.right(轉向角度[n]) ... else: ... turtle.left(-轉向角度[n]) ... turtle.forward(餘步列[n]) ... turtle.seth(保存原向) ... >>> # 自光明 >>> turtle.reset();turtle.color('red', 'yellow');turtle.begin_fill();知心();turtle.end_fill() >>>
【畫圓】
【知心】
【自光明】
勒☆