Estudio de curvas en el plano con Mathematica (del libro de Cordero, Gray, Fernández)

2.1 Cálculo de la curvatura de una curva en el plano

J[{p1_, p2_}] := {-p2, p1}

kappa2[alpha_][
        t_] := 
D[alpha[tt], {tt, 2}] . 
            J[D[alpha[tt], tt]]/
Simplify[
              D[alpha[tt], tt] . D[alpha[tt], tt]]^(3/2) /. 
        tt -> t

kappa2[alpha][t]

eight[t_] := {Sin[t], Sin[t] Cos[t]}

kappa2[eight][Pi/2]

Expand[kappa2[eight][t]]

ParametricPlot[eight[t], {t, 0, 2  Pi}, 
        AspectRatio -> Automatic];

Plot[kappa2[eight][t], {t, 0, 2  Pi}];

2.2 Cálculo de longitudes de curvas

arclengthprime[alpha_][t_] := 
      Sqrt[Simplify[
            D[alpha[tt], tt] . 
D[alpha[tt], tt]]]  /. 
        tt -> t

arclength[alpha_][t_] := 
      Integrate[arclengthprime[alpha][tt], tt]  /. 
        tt -> t

Longitud de la curva alpha

length[a_, b_][alpha_] := 
      Integrate[arclengthprime[alpha][u], {u, a, b}]

Obtención del valor numérico para la longitud de la curva alpha

lengthn[a_, b_][alpha_] := 
      NIntegrate[arclengthprime[alpha][u], {u, a, b}]

sc[t_]:={t^2, t^3}

Simplify[
      PowerExpand[length[a, b][sc] /. 
          Sqrt[x_] :> Sqrt[Factor[x]]]]

lengthn[1, 2][sc]

N[length[1, 2][sc]]

2.4 Ejemplos de curvas en (R^2)

circle[r_][t_] := {r Cos[t], r Sin[t]}

ParametricPlot[circle[2][t], {t, 0, 2  Pi}, 
        AspectRatio -> Automatic];

ellipse[a_, b_][t_] := {a Cos[t], b Sin[t]}

ParametricPlot[ellipse[2, 1][t] // Evaluate, {t, 0, 2  Pi}, 
        AspectRatio -> Automatic];

kappa2[ellipse[a, b]][t]

Plot[kappa2[ellipse[2, 1]][t] // Evaluate, {t, 0, 
          2  Pi}];

logspiral[a_, b_][t_] := 
      a*{E^(b*t)  Cos[t], E^( b*t)  Sin[t]}

ParametricPlot[logspiral[1, 0.08][t] // Evaluate, {t, 0, 
          12  Pi}, 
AspectRatio -> Automatic, 
        Ticks -> None, PlotPoints -> 55];

PowerExpand[Simplify[kappa2[logspiral[a, b]][t]]]

Plot[kappa2[logspiral[1, 0.08]][t] // Evaluate, {t, 0, 
          12  Pi}];

Curvas planas famosas

3.1 Cicloides

cycloid[a_, b_][t_] := {a*t  -  b*Sin[t], 
        a - b*Cos[t]}

ParametricPlot[cycloid[1, 1][t] // Evaluate, {t, -Pi/2, 
          5  Pi/2}, AspectRatio -> Automatic];

Plot[kappa2[cycloid[1, 1]][t] // Evaluate, {t, 0, 2  Pi}, 
        Ticks -> {Range[0, 2  Pi, Pi/2], Automatic}];

3.2 Lemniscatas de Bernouilli

lemniscate[a_][t_] := {a*Cos[t]/(1 + Sin[t]^2), 
        a*Sin[t]*Cos[t]/(1 + Sin[t]^2)}

ParametricPlot[
        Table[lemniscate[a][t], {a, 2, 8, 2}] // Evaluate, {t, 0, 2  Pi}, 
        AspectRatio -> Automatic];

Plot[kappa2[lemniscate[1]][t] // Evaluate, {t, 0, 
          2  Pi}];

3.3 Cardiodes

cardioid[a_][t_] := {2  a*Cos[t] (1 + Cos[t]), 
        2  a*Sin[t]*(1 + Cos[t])}

ParametricPlot[
        Table[cardioid[a][t], {a, 1, 4, 1}] // Evaluate, {t, 0, 
          2  Pi}, 
AspectRatio -> 
          Automatic];

Plot[kappa2[cardioid[1]][t] // Evaluate, {t, 0, 
          2  Pi}];

Simplify[kappa2[cardioid[a]][t]]

3.4 La cisoide de Diocles

cissoid[a_][t_] := {2  a t^2/(1 + t^2), 
        2  a t^3/(1 + t^2)}

ParametricPlot[cissoid[1][t] // Evaluate, {t, -2, 2}, 
        AspectRatio -> 2, Ticks -> {Range[0, 2, 0.5], Automatic}, 
        PlotRange -> All];

Simplify[kappa2[cissoid[a]][t]]

Plot[kappa2[cissoid[1]][t] // Evaluate, {t, -1, 
          1}];

3.5 La tractriz

tractrix[a_][t_] := a {Sin[t], Cos[t] + Log[Tan[t/2]]}

ParametricPlot[tractrix[1][t] // Evaluate, {t, 0.01, 0.99 Pi}, 
        AspectRatio -> 3, PlotPoints -> 50, 
        PlotRange -> {Automatic, {-3.0, 3.0}}, 
        Ticks -> {Range[0, 1, 0.5], Automatic}];

Plot[Evaluate[kappa2[tractrix[1]][t]], {t, 0, Pi}];

3.6 Clotoides

clotoidprime[n_, a_][t_] := 
      a {Sin[t^(n + 1)/(n + 1)], 
          Cos[t^(n + 1)/(n + 1)]}

clotoid[n_, a_][t_] := 
      Integrate[clotoidprime[n, a][tt], {tt, 0, t}]

ParametricPlot[clotoid[1, 1][t] // Evaluate, {t, -10, 10}, 
        AspectRatio -> Automatic];

ParametricPlot[Evaluate[clotoid[2, 0.5][t]], {t, -6, 6}, 
      AspectRatio -> Automatic, 
      Ticks -> {Range[-0.1, 0.5, 0.2], Automatic}, 
      PlotRange -> {{-0.1, 0.5}, Automatic}]

Curvas en el plano definidas implícitamente

Needs["Graphics`ImplicitPlot`"]

ImplicitPlot[
        x^3 + y^3 - 3  x*y == -0.1, {x, -3, 3}];

ImplicitPlot[x^2 + 2 y^2 == 3, {x, -2, 2}]

folium[t_] := {3  t/(1 + t^3), 3 t^2/(1 + t^3)}

ParametricPlot[folium[t] // Evaluate, {t, -30, 30}, 
        PlotRange -> {Automatic, {-3.5, 2}}, 
        AspectRatio -> Automatic];

4.2 Óvalos de Cassini

cassini[a_, b_][x_, y_] := (x^2 + y^2 + a^2)^2 - b^4 - 
        4  a^2 x^2

ImplicitPlot[cassini[1, 2][x, y] == 0, {x, -8, 
          8}];

ImplicitPlot[cassini[4.01, 4][x, y] == 0, {x, -8, 
          8}];

ImplicitPlot[
        Table[cassini[a, 2][x, y] == 0, {a, 0, 4, 0.2}] // 
          Evaluate, {x, -5, 5}];

4.3 Curvas planas en coordenadas polares

logspiralpolar[a_, b_][theta_] := a E^(b theta)

Needs["Graphics`Graphics`"]

PolarPlot[logspiralpolar[1, 0.08][theta] // Evaluate, {theta, 0, 
          12 Pi}];

limaconpolar[n_, a_, b_][theta_] := 
      2  a Cos[n theta] + b

PolarPlot[limaconpolar[3,  .5, 2][theta] // Evaluate, {theta, 0, 
          2  Pi}];

Espiral de Arquímedes: r=theta

PolarPlot[t, {t, -4 Pi, 4  Pi}]

Espiral de Fermat: r^2=theta

PolarPlot[{t^(1/2), -t^(1/2)}, {t, 0, 
          4  Pi}];

Espiral hiperbólica: r=2/theta

PolarPlot[2/t, {t, -4 Pi, 4  Pi}];