Function Repository Resource:

Curvature

Source Notebook

Compute the curvature of a curve

Contributed by: Wolfram Staff (original content by Alfred Gray)

ResourceFunction["Curvature"][c,t]

computes the curvature of curve c parametrized by t.

Details and Options

The curvature κ is also called the "first curvature".
The curvature of a curve is defined as κ=(x'y''-y'x'')/(x'2+y'2)3/2.

Examples

Basic Examples (4) 

Plot the twisted cubic curve:

In[1]:=
ParametricPlot3D[{t, t^2, t^3}, {t, -5, 5}]
Out[1]=

Compute the curvature of the twisted cubic curve:

In[2]:=
ResourceFunction["Curvature"][{t, t^2, t^3}, t]
Out[2]=

Compute the torsion with the resource function CurveTorsion:

In[3]:=
ResourceFunction["CurveTorsion"][{t, t^2, t^3}, t]
Out[3]=

Plot them:

In[4]:=
Plot[{%, %%}, {t, 0, 1}]
Out[4]=

Scope (4) 

For a plane curve, the curvature and torsion are the same:

In[5]:=
ResourceFunction["Curvature"][{3 t - t^3, 3 t^2, 3 t + t^3}, t] // Simplify
Out[5]=
In[6]:=
Simplify[
 ResourceFunction["CurveTorsion"][{3 t - t^3, 3 t^2, 3 t + t^3}, t], t > 0]
Out[6]=

Make a plot:

In[7]:=
Plot[{%, %%}, {t, -2, 2}]
Out[7]=

A curve that is qualitatively similar to a torus knot:

In[8]:=
torusknot[a_, b_, c_][p_, q_][
  t_] := {(a + b Cos[q t]) Cos[p t], (a + b Cos[q t]) Sin[p t], c Sin[q t]}

Plot the knot:

In[9]:=
ParametricPlot3D[torusknot[8, 3, 5][2, 5][t], {t, 0, 2 \[Pi]}]
Out[9]=

Find the curvature:

In[10]:=
ResourceFunction["Curvature"][torusknot[8, 3, 5][2, 5][t], t] // Simplify
Out[10]=

Plot it:

In[11]:=
Plot[%, {t, 0, 2 \[Pi]}]
Out[11]=

Find the torsion with the resource function CurveTorsion:

In[12]:=
ResourceFunction["CurveTorsion"][torusknot[8, 3, 5][2, 5][t], t] // Simplify
Out[12]=

Plot the torsion:

In[13]:=
Plot[%, {t, 0, 2 \[Pi]}]
Out[13]=

Define a loxodrome:

In[14]:=
loxodromes[a_, b_] := {2 a E^(b u) Cos[u], 2 a E^(b u) Sin[u], a^2 E^(2 b u) - 1}/(1 + a^2 E^(2 b u))
In[15]:=
loxodromes[1, 0.1]
Out[15]=

Compute its curvature:

In[16]:=
cur = ResourceFunction["Curvature"][loxodromes[1, 1/10], u] // FullSimplify
Out[16]=

Plot the curvature:

In[17]:=
gr = Plot[cur, {u, -4 \[Pi], 4 \[Pi]}, PlotRange -> All]
Out[17]=

A curve colored according to its curvature value:

In[18]:=
range = Last[PlotRange /. AbsoluteOptions[gr, PlotRange]];

Show[ParametricPlot3D[loxodromes[1, 0.1], {u, -4 Pi, 4 Pi}, ColorFunction -> Function[{x, y, z, u, v}, ColorData["Rainbow"][Rescale[cur, range]]], ColorFunctionScaling -> False, PlotStyle -> Thickness[0.01]], Graphics3D[{Opacity[0.2], Sphere[]}]]
Out[18]=

A plane curve in polar coordinates:

In[19]:=
archimedesspiralpolar[n_, a_][theta_] := a theta^(1/n)
In[20]:=
archimedesspiralpolar[2, 1][t]
Out[20]=

Plot it:

In[21]:=
PolarPlot[archimedesspiralpolar[2, 1][t], {t, 0, 5 \[Pi]}]
Out[21]=

The curvature:

In[22]:=
FullSimplify[
 ResourceFunction["Curvature"][archimedesspiralpolar[2, 1][t], t], t > 0]
Out[22]=

Properties and Relations (4) 

The curvature of a circle:

In[23]:=
ResourceFunction["Curvature"][a {Cos[t], Sin[t]}, t] // PowerExpand
Out[23]=

The curvature of the Cornu spiral:

In[24]:=
ResourceFunction["Curvature"][
  Entity["PlaneCurve", "CornuSpiral"]["ParametricEquations"][a][t], t] // PowerExpand
Out[24]=

Define a conical spiral:

In[25]:=
cs = Entity["SpaceCurve", "ConicalSpiral"]["ParametricEquations"][1, 1][t]
Out[25]=

Compute the curvature:

In[26]:=
\[Kappa] = ResourceFunction["Curvature"][cs, t] // FullSimplify
Out[26]=

Definition of a unit speed helix:

In[27]:=
uhelix = {a Cos[t/Sqrt[a^2 + b^2]], a Sin[t/Sqrt[a^2 + b^2]], (b t)/
   Sqrt[a^2 + b^2]};

The curvature:

In[28]:=
\[Kappa] = Simplify[ResourceFunction["Curvature"][uhelix, t], a > 0 && b > 0 && t > 0]
Out[28]=

The tangent vector, via the resource function TangentVector:

In[29]:=
tan = Simplify[ResourceFunction["TangentVector"][uhelix, t], a > 0 && b > 0 && t > 0]
Out[29]=

Derivative of the tangent vector:

In[30]:=
D[tan, t]
Out[30]=

The normal vector, via the resource function NormalVector:

In[31]:=
n = Simplify[ResourceFunction["NormalVector"][uhelix, t], a > 0 && b > 0 && t > 0]
Out[31]=

The curvature times the normal vector is equal to the derivative of the tangent vector:

In[32]:=
\[Kappa] n
Out[32]=

The torsion, via the resource function CurveTorsion:

In[33]:=
\[Tau] = Simplify[ResourceFunction["CurveTorsion"][uhelix, t], a > 0 && b > 0 && t > 0]
Out[33]=

In the Frenet–Serret system, the curvature and the torsion are the first two quantities:

In[34]:=
FrenetSerretSystem[uhelix, t] // PowerExpand // Simplify
Out[34]=

Publisher

Enrique Zeleny

Version History

  • 2.0.0 – 30 April 2020
  • 1.0.0 – 28 April 2020

Source Metadata

Related Resources

License Information