' - - File: VI_Tan1.txt

' Given a 2D function, find the tangent line at a given position. Plot both the function & line.
x1 = 1
Rx{t} = t  :  Ry{t} = -2*t^3 + 3*t    :  Rz{t} = 0  :  R<t> = <Rx, Ry, Rz>
D<t> = vDiff[R]

T<t> = vDiv[D,sMag[D] ]              ' dR/dt / |dR/dt |  =  dR/ds  = T (tangent vector)
Rn<t> =vEval[R,x1]
Tn<t> = vEval[T,x1]
L<t> = vAdd[vMpy[Tn,#],Rn]       ' Tangent line; # is parameter position.

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

<t = 1>
m = T.y | x1 / T.x |x1                      ' Take y-component / x-component at x1 value.
'@Slope = @m, units.!
