Tangents and Normals

This notebooks show how to use Mathematica  to compute tangent and normal vectors to curves, and tangent planes and normal lines to surfaces.

Needs["Calculus`Advanced`"]

Example: Twisted Cubic Curve

Find the unit tangent and unit normal vectors to the curve

r[t_] = {t,t^2,t^3};

Solution:

v[t_] = r'[t]

a[t_] = v'[t]

speed[t_] = Norm[v[t]] //Simplify

T[t_] = r'[t]/Norm[r'[t]] //Simplify

n[t_] = T'[t]/Norm[T'[t]] //Simplify

The length of the curve from t==0 to t==1 is:

NIntegrate[speed[t], {t,0,1}]

curve = ParametricPlot3D[r[t], {t,0,2}]

tangents = Table[Vector[r[t],r[t]+T[t]], {t,0,2,.5}]

normals  = Table[Vector[r[t],r[t]+n[t]], {t,0,2,.5}]

Show[tangents,normals,curve]

Example: Helix

Find the unit tangent and unit normal vectors to the curve

r[t_] = {Cos[t], Sin[t], t/4};

Solution:

v[t_] = r'[t]

a[t_] = v'[t]

speed[t_] = Norm[v[t]] //Simplify

T[t_] = r'[t]/Norm[r'[t]] //Simplify

n[t_] = T'[t]/Norm[T'[t]] //Simplify

curve = ParametricPlot3D[r[t], {t,0,10}]

tangents = Table[Vector[r[t],r[t]+T[t]], {t,5,8,.5}]

normals  = Table[Vector[r[t],r[t]+n[t]], {t,5,8,.5}]

Show[tangents,normals,
Graphics3D[{RGBColor[1,0,0],curve[[1]]}]]

Example:

Find the eqn of the plane tangent to the graph of

f[x_,y_] = (x+2)/(y+1);

at the point {2,3,1}.

Solution:

The graph is the level surface of the function

g[x_,y_,z_] = z - f[x,y];

Grad[g[x,y,z]]

The normal vector to this level surface at {2,3,1} is:

n = Grad[g[x,y,z]] /. {x->2, y->3}

The eqn of the plane is:

n.{x,y,z} == n.{2,3,1}

Solve[%, z]

surf = Plot3D[f[x,y],{x,0,4}, {y,0,4}]

tang = Plot3D[(5 + x - y)/4, {x,0,4}, {y,0,4}]

norm = ParametricPlot3D[{2-t/4,3+t/4,1+t}, {t,-2,2}]

Show[surf, tang, norm, BoxRatios->Automatic,
	ViewPoint->{2.613, -1.212, 1.775}]

Example:

Find the eqn of the plane tangent to the sphere

x^2 + y^2 + z^2 == 3

at the point {1,1,1}.

Solution:

The sphere is a level surface of

f[x_,y_,z_] = x^2 + y^2 + z^2;

n = Grad[f[x,y,z]] /. {x->1, y->1, z->1}

Tangent plane:

n.{x,y,z} == n.{1,1,1}

surf = Plot3D[Sqrt[3 - x^2 - y^2], {x,0,2}, {y,0,2}]

tang = Plot3D[3 - x - y, {x,0,2}, {y,0,2}]

norm = ParametricPlot3D[{1+t,1+t,1+t}, {t,-1,1}]

Show[surf, tang, norm, BoxRatios->Automatic]