' - - File: VI_tnb4.txt
' Time about 30 seconds on my notebook.
' An example of finding the tangent, normal, and binormal for a spiral path.
pi = 3.14159

t1 = 1  :  ph = pi/20                                             ' ph is phase shift.
' Define the function.
Rx{t} = 2*Cos[3*pi*t+ph]  :  Ry{t} = 2*Sin[3*pi*t+ph]  :  Rz{t} = t
' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
R<t> = <Rx, Ry, Rz>
D<t> = vDiff[R]                            ' dR/dt
T<t> = vDiv[D, sMag[D]]             ' (dR/dt) / |dR/dt|  = (dR/dt) / (ds/dt) = dR/ds = T

Rn<t> = vEval[R,t1]
Tn<t> = vEval[T,t1]
L<t> = vAdd[vMpy[Tn,#],Rn]      ' Tangent line. Recall # symbol replaces parameters
                                                      '  in vector algebra.

' - - - - - - - - - - - - - - - - - - - Find the Normal line to plot - - - - - - - - - - - - - - - - - - - - - - -
Td<t> = vDiff[T]                           '  dT / dt
A<t> = vDiv[Td,sMag[D]]            ' (dT/dt) / |dR/dt| = (dT/dt) / (ds/dt) = dT/ds
N<t> = vDiv[A,sMag[A] ]             ' N = (dT/ds) / |dT/ds |
Nn<t> = vEval[N,t1]
P<t> = vAdd[vMpy[Nn,#],Rn]

' - - - - - - - - - - - - - - - - - - Find the  BiNormal line toPlot - - - - - - - - - - - - - - - - - - - - - -
B<t> = vCross[T,N]
Bn<t> = vEval[B,t1]
H<t> = vAdd[vMpy[Bn,#],Rn]

t0 = 0  :  tf = 2  :  n = 100
Plot[R,L,P,H, {t, t0, tf, n}]





