Topic

Curves: length, curvature, torsion

A curve is a list of two or three formulas in one parameter. curve differentiates them and returns what a first course in differential geometry computes, each as a formula and as a certified value at a point: speed and arc length, the Frenet frame, curvature and torsion, the osculating circle and the evolute.

const helix = curve(["cos(t)", "sin(t)", "t/2"], "t");
helix.speed();              // "sqrt(5/4)"
helix.curvature();          // "4/5"
helix.torsion();            // "2/5"
helix.length([0, "2*pi"]);  // an interval around π√5

const a = helix.at(1);      // every number an interval
a.tangent; a.normal; a.binormal;
a.curvature;                // [4/5, 4/5]
a.radius; a.centre;         // the osculating circle

It is also available as import { curve, surface, metric } from "@ratmath/analytic/geometry".

Speed and arc length

For r(t)r(t) the velocity is r′(t)r'(t) and the speed is ∣r′(t)∣|r'(t)|. The length of the curve between t=at = a and t=bt = b is

L=∫ab∣r′(t)∣ dt. L = \int_a^b |r'(t)|\,dt .

length encloses that integral; the ends may be formulas such as "2*pi". A curve is regular where the speed is not zero. At a point where the velocity may vanish, such as the cusp of (t2,t3)(t^2, t^3) at 0, there is no tangent and at refuses.

Curvature

Curvature measures how fast the unit tangent T=r′/∣r′∣T = r'/|r'| turns per unit of length: κ=∣dT/ds∣\kappa = |dT/ds|. In terms of the parameter,

κ=∣r′×r′′∣∣r′∣3in space,κ=x′y′′−y′x′′(x′2+y′2)3/2in the plane. \kappa = \frac{|r' \times r''|}{|r'|^3} \quad\text{in space}, \qquad \kappa = \frac{x'y'' - y'x''}{(x'^2 + y'^2)^{3/2}} \quad\text{in the plane}.

In the plane the curvature has a sign: positive where the curve turns to the left. A circle of radius RR has curvature 1/R1/R, a line has curvature 0.

The osculating circle at a point is the circle that fits the curve best there: it passes through the point with the same tangent and the same curvature. Its radius is 1/∣κ∣1/|\kappa| and its centre is r+N/κr + N/\kappa, where NN is the unit normal. The centres trace the evolute; evolute() returns it as another curve, so the evolute of a parabola is one line of code.

The integral of the curvature against arc length is the total turning of the tangent. For a simple closed curve in the plane it is 2π2\pi, whatever the shape; totalCurvature encloses it.

The Frenet frame and torsion

In space the unit tangent TT, the principal normal N=T′/∣T′∣N = T'/|T'| and the binormal B=T×NB = T \times N form a frame that travels with the curve. The Frenet formulas say how it turns:

T′=κN,N′=−κT+τB,B′=−τN(derivatives in arc length). T' = \kappa N, \qquad N' = -\kappa T + \tau B, \qquad B' = -\tau N \qquad (\text{derivatives in arc length}).

The torsion τ\tau measures how fast the curve leaves its osculating plane:

τ=(r′×r′′)⋅r′′′∣r′×r′′∣2. \tau = \frac{(r' \times r'') \cdot r^{\prime\prime\prime}}{|r' \times r''|^2}.

A curve lies in a plane exactly when its torsion is zero, and a curve with constant curvature and constant torsion is a helix. Where the curvature may be zero the normal and binormal are not defined, and at reports them as null.

Formulas that come out readable

The formulas are tidied by tidy, which writes a formula as a quotient of polynomials in its variables and function calls, uses sin⁡2+cos⁡2=1\sin^2 + \cos^2 = 1 and P 2=P\sqrt{P}^{\,2} = P, and cancels the common factor. It is exported for use on your own formulas: format(tidy(parse("(x^2 - 1)/(x - 1)"))) is "x + 1".

callreturns
curve(components, parameter = "t", { params })Curve, in the plane or in space
c.position, c.velocity, c.accelerationformulas
c.speed(), c.curvature(), c.torsion()formulas
c.evolute()Curve (plane curves)
c.length([a, b], { digits = 12 }), c.totalCurvature([a, b])RationalInterval
c.at(t, { digits = 15 }){ point, velocity, speed, tangent, normal, binormal, curvature, torsion, radius, centre }
tidy(tree)the tidied formula tree
Try itEdit the code and run it with @ratmath/analytic and Core's R, Rational, RationalInterval in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.
Ctrl/⌘ + Enter runs