# Tangent Vector and Tangent Line

Consider a fixed point *X* and a moving point *P*
on a curve. As point *P* moves toward *X*, the
vector from *X* to *P* approaches the tangent
vector at *X*. The line that contains the tangent vector
is the tangent line.

Computing the tangent vector at a point is very simple. Recall from your
calculus knowledge that the derivative of parametric curve **f**(*u*)
is the following:

**f**'(*u*) = ( *f*'(*u*),
*g*'(*u*),
*h*'(*u*) )

where *f*'(*u*) = d*f*/d*u*,
*g*'(*u*) = d*g*/d*u* and
*h*'(*u*) = d*h*/d*u*.
In general, the length of the tangent vector **f**'(*u*) is not one,
and normalization is required. That is, the unit-length tangent vector
at parameter *u*, or at point **f**(*u*), is

**f**'(*u*) / | **f**'(*u*) |

where | **x** | is the length of vector **x**.
The tangent line at **f**(*u*) is either
**f**(*u*) + *t***f**'(*u*)

or if unit-length direction vector is preferred
**f**(*u*) +
*t*(**f**'(*u*)/|**f**'(*u*)|)

where *t* is a parameter.

### Examples

- Consider the circle
**f**(*u*) =
( *r*cos(2*PI**u*) + *p*,
*r*sin(2*PI**u*) + *q* ), where *u* is in the
range of 0 and 1. We have the tangent vector at *u* as
follows:
**f**'(*u*) =
( -2*PI**r*sin(2*PI**u*),
2*PI**r*cos(2*PI**u*) )

and the tangent line at **f**(*u*):
**f**(*u*) + *t***f**'(*u*)
= ( *r*cos(2*PI**u*) + *p*,
*r*sin(2*PI**u*) + *q* ) + *t*
( -2*PI**r*sin(2*PI**u*),
2*PI**r*cos(2*PI**u*)

- Consider a space cubic curve
**f**(*u*) =
( *u*, *u*^{2}, *u*^{3} ).
We have tangent vector **f**'(*u*) =
( 1, 2*u*, 3*u*^{2} ) and tangent
line **f**(*u*) + *t***f**'(*u*) =
( *u* + *t*, *u*^{2} + 2*tu*,
*u*^{3} + 3*tu*^{2} ), where *t*
is the line parameter.
- The circular helix curve has an equation as follows:
**f**(*u*) = ( *a*cos(*u*),
*a*sin(*u*), *bu* )

It has tangent vector
**f**'(*u*) =
( -*a*sin(*u*), *a*cos(*u*), *b* )

and tangent line
**f**(*u*) + *t***f**'(*u*) =
( *a*(cos(*u*) - *t*sin(*u*)),
*a*(sin(*u*) + *t*cos(*u*)),
*b*(*t*+*u*) )