Instructions
The functions defined in this notebook will allow you to compute the Frenet-Serret apparatus for a regular curve.  (We don’t even need an arc-length parametrization!)

The first thing you should do is compile the block of code immediately below this text cell.  You can do this either by clicking somewhere in the cell and then pressing ‘Shift+Enter’ or by right-clicking the long, thin bar on the right side of the cell and clicking ‘Evaluate cell.’  You should not edit this block of code, and you also don’t have to read it if you don’t want to.

Once you’ve compiled this block, you’ll have access to three functions, each of which requires as input a regular parametrization (which you’ll need to define).  These functions are
  1. frameManipulate, which will produce a controllable animation of the Frenet-Serret frame along your curve;
  2. curvature, which will calculate the curvature of your curve as a function of its independent variable;
  3. torsion, which will calculate the torsion of your curve as a function of its independent variable.
There’s an example below the block that defines these functions, which you are strongly suggested to check out before you start with your own curves.

Note: These functions all assume that your parametrization is regular.  Make sure this is the case, or you’ll end up with error messages!

(*the following module accepts as input:
	a function g of a single variable, whose output is a triple
	a value tm, taken to be the minimum value for the input of g
	a value tM, taken to be the maximum value for the input of g
	a list {{xm,xM},{ym,yM},{zm,zM}}, used as the PlotRange for our plot
*)
(*it is assumed that g is a regular parametrization, meaning that g'[t] is never zero. if this is not true, division by zero will occur.*)
frameManipulate[g_,tm_,tM_,{{xm_,xM_},{ym_,yM_},{zm_,zM_}}]:=Module[{vT,vN,vB,plot},
(*we now define the Frenet-Serret frame using the formulas for regular parametrizations --- i.e., not necessarily arclength parametrizations*)
vT[t_]:=((g'[t])/(Norm[g'[t]]));
vB[t_]:=((Cross[g'[t],g''[t]])/(Norm[Cross[g'[t],g''[t]]]));
vN[t_]:=Cross[vB[t],vT[t]];
(*a plot of the curve is set before creating the manipulate*)
plot=ParametricPlot3D[g[t],{t,tm,tM},PlotRange->{{xm,xM},{ym,yM},{zm,zM}}];
Return[
Manipulate[
Show[
plot,
Graphics3D[{
{Arrow[{g[tt],g[tt]+vT[tt]}]},
{Red,Arrow[{g[tt],g[tt]+vN[tt]}]},
{Purple,Arrow[{g[tt],g[tt]+vB[tt]}]}
}],
ListPointPlot3D[{g[tt]},PlotStyle->{{Green,PointSize[0.025]}}]
],
{tt,tm,tM}],
Module];
];

(*the following functions accept as input the name of a previously-defined parametrization g, as well as an independent variable t*)
(*they compute the curvature and torsion, respectively, of the curve, assuming that the parametrization is regular*)
(*if the parametrization is not regular, division by zero will occur*)
curvature[g_,t_]:=((Norm[Cross[g'[t],g''[t]]])/(((Norm[g'[t]]))^3));
torsion[g_,t_]:=((Cross[g'[t],g''[t]].g'''[t])/(((Norm[Cross[g'[t],g''[t]]]))^2));

Example
Now we’ll use each of the three functions defined above.  When creating your own code below, you can copy and paste the code you see here, then swap out the relevant functions and numbers.

First, we define the curves in which we’re interested.  Inside the curly brackets are the x-, y-, and z-components.  To create more curves, copy the format seen here.

curve1[t_]:={t*Cos[6t],t*Sin[6t],t};
curve2[t_]:={Exp[-t]*Cos[6t],Exp[-t]*Sin[6t],0};
(* The notation 'Exp[-t]' is equivalent to the mathematical expression (E^(-t)). *)

Once we’ve defined a curve, we can create a Manipulate which allows us to watch the Frenet-Serret frame evolve.
In the following, ‘curve1’ is the name of the curve we’ve defined above, without the variable, 0 is the lower bound for our independent variable, and Pi is the upper bound.  Replace these as needed.
The numbers {{-Pi,Pi},{-Pi,Pi},{0,Pi}} give our PlotRange (that is, the view window).  In the x- and y-directions, we range from -Pi to Pi, while in the z-direction, we range from 0 to Pi.  Again, change these as needed.
The following cell will not compile until you have compiled the previous cell! That is, you must define the curve first (in addition to the Module ‘frameManipulate’). The same goes for later cells which call curve1 or curve2.

frameManipulate[curve1,0,Pi,{{-Pi,Pi},{-Pi,Pi},{0,Pi}}]

Finally, the functions ‘curvature’ and ‘torsion’ give the curvature and torsion, respectively, of a previously-defined curve.
We call these by writing curvature[<curve>,<var>] and torsion[<curve>,<var>], respectively, where <curve> is the name of your curve without the variable, and <var> is the independent variable.
For instance, assuming the above cells have been compiled, we can calculate the curvature and torsion of curve1:

curvature[curve1,t]
torsion[curve1,t]

The algebraic expressions of the functions probably aren’t so nice to look at.  In the following, we can compare the curvatures and torsions of our curves by plotting:

Plot[{
curvature[curve1,t],
curvature[curve2,t ]
},{t,0,Pi}]

Plot[{
torsion[curve1,t],
torsion[curve2,t]
},{t,0,Pi}]

Or we could simultaneously plot the curvature and torsion of a single curve:

Plot[{
curvature[curve1,t],
torsion[curve1,t]
},{t,0,Pi}]

Your code
Type your code below (or just copy the code from above and substitute as needed).
Remember that you can compile a code cell using ‘Shift+Enter’.
Warning: Don’t type code directly into this cell, as it only accepts text.  Type your code in a new cell below.