Finding unit tangent, normal, and binormal vectors for a given r(t)
Mathematica
wouldn't be much helpful if one applied only formulae calculated by hand.
Here we demonstrate how to calculate the desired geometric objects with the system having a definition of the curve r[t]
:
r[t_] := {t, t^2, t^3}
now we call uT
the unit tangent vector to r[t]
. Since we'd like it only for real parameters we add an assumption to Simplify
that t
is a real number. Similarly we can do it for the normal vector vN[t]
and the binormal vB[t]
:
uT[t_] = Simplify[ r'[t] / Norm[ r'[t] ], t ∈ Reals];
vN[t_] = Simplify[ uT'[t]/ Norm[ uT'[t]], t ∈ Reals];
vB[t_] = Simplify[ Cross[r'[t], r''[t]] / Norm[ Cross[r'[t], r''[t]] ], t ∈ Reals];
let's write down the formulae :
{uT[t], vN[t], vB[t]} // Column // TraditionalForm
Edit
Definitions provided above are clearly more useful than only to write them down. They are powerful enough to animate a moving reper along a curve r[t]
. Indeed the vectors uT[t]
, vN[t]
and vB[t]
are orthogonal and normalized, e.g.
Simplify[ Norm /@ {uT[t], vN[t], vB[t]}, t ∈ Reals]
{1, 1, 1}
To demonstrate a moving reper we can use ParametricPlot3D
and Arrow
enclosed in Animate
:
Animate[
Show[ ParametricPlot3D[ {r[t]}, {t, -1.3, 1.3}, PlotStyle -> {Blue, Thick}],
Graphics3D[{ {Thick, Darker @ Red, Arrow[{r[s], r[s] + uT[s]}]},
{Thick, Darker @ Green, Arrow[{r[s], r[s] + vB[s]}]},
{Thick, Darker @ Cyan, Arrow[{r[s], r[s] + vN[s]}]}}],
PlotRange -> {{-2, 2}, {-2, 2}, {-2, 2}}, ViewPoint -> {4, 6, 0},
ImageSize -> 600],
{s, -1, 1}]
Observe that even when the tangent vector $r'(t)$ is not normalized, it is still a linear combination of $T(t)$ and $N(t)$. Thus--operating under the usual assumptions that $r'$ and $r''$ exist and are linearly independent--all we have to do is make an orthonormal frame out of $r'(t)$ and $r''(t)$ (which is very much in the spirit of the entire proceeding). It often helps to do the simplification on the spot, so let's include that too. In the following, the calculation itself is the middle line, enclosed by the simplification code:
frame[r_] := Function[{t}, Evaluate[FullSimplify[
Append[#, Cross @@ #] &@ Orthogonalize[D[r[t], {t, #}] & /@ {1, 2}, Dot],
Assumptions -> t ∈ Reals]]]
(If you read the second line in reverse you can tell exactly what it does: take the first two derivatives, orthogonalize them, and throw in their cross product. Including Dot
as an option to Orthogonalize
does not change the calculation but makes it much easier for Mathematica to simplify the ensuing expressions.)
This object frame
transforms any twice-differentiable 3-vector-valued function into a frame-valued function, which returns a list of three 3-vectors; namely, the unit tangent, normal and binormal $\{T(t), N(t), B(t)\}$. For instance, the example in the question can now be addressed by
frame[{#, #^2, #^3} &][t] // TraditionalForm
The method used in frame
generalizes to higher (and lower) dimensions: sequentially orthogonalize the first $n-1$ derivatives (in order) and use the wedge product (a generalization of Cross
) to obtain the last element of the frame. The wedge product (which is applied to an ordered list of $n-1$ $n$-vectors) can be implemented as Dot[LeviCivitaTensor[Length[#]+1], Sequence @@ #]&
.
Mathematica 10 provides new functionality dealing with curves, (see e.g. the Vector Analysis tutorial) like ArcLength
, ArcCurvature
and especially
FrenetSerretSystem
:
FrenetSerretSystem[{ x1, ..., xn}, t] gives the generalized curvatures and Frenet-Serret basis for the parametric curve x[t] i.e. it returns {{ k1, ..., k(n-1)}, { e1, ..., en}}, where ki are generalized curvatures and ei are the Frenet-Serret basis vectors.
Symbolically it yields
FrenetSerretSystem[ r[t], t] // TraditionalForm
Since we are interested in the Frenet-Seret basis only, having defined
r[t_] := {t, t^2, t^3}
we can evaluate:
FrenetSerretSystem[ r[t], t] // Last // Simplify // Column // TraditionalForm
With FrenetSerretSystem
we don't need to define every base vector separately and we can use it also in animations like in the accepted answer.