Definition: The unit tangent vector T at a point (x,y) on a path C is the unit vector tangent to the path at that point, pointing in the direction of travel. Note that the direction of travel singles out one of the two possible directions for T.
The unit tangent vector is useful to know if you are trying to compute the work done by some force field F as you move along a path. This is becaue it is onlt the component of the force in the direction of motion, namely,
dot(F,T)
that is relevant.
Now, another thing we compute is "fluxes". That is, we think of the vector field F as representing the velocity vector of a fluid at the point (x,y). We also think of the path C, if it is closed, say, as being the boundary of a region.
Note that while our discussion of unit tangent vectors and their meaning makes sense in any dimension, it is only in two dimensions that a curve can bound a region. A three dimensional region needs a two dimensional surface to bound it. So that's why "in the plane" appears in the tilte of this section. Anyway, for closed, simple curves in the plane, there is an inside and an outside, and there are two directions perpendicular to the unit tangent: namely the unit outward normal N and the unit inward normal -N. By convention, we usually talk about the outward normal, so the inward normal gets the minus sign.
In any case, getting back to what fluxes are, consider a simple closed curve C bounding some region in the plane. In general there is fluid flowing in some parts of the bounday and out some others. The total flux into the region is the net amount flowing in per unit time.
To compute this, you chop the boundary up into lots of tiny segments, and consider the rate at which fluid is flowing in or out across each one. Then you add these up.
Now the rate at which fluid is flowing in or out across such a segment depends on the velocity field F at the segemnt (since the segment is really small, we can treat this as constant). But not on the whole thig: The tangential component of the velocity just pushes fluid along Parallel to the boundary, and doesn't move anything across it. It doesn't produce any flux. The flux is produces by the normal component; this is waht moves stuff across.
Hence, for computing the rate at which fluid flows out at a opint on the boundary, it is
dot(F,N)
that is relevant.
First, you parameterize the path.
Once you have a prameterization
(x(t),y(t)) , [a,b]
in hand, you compute the velocity vector (x'(t),y'(t)) but differentiating the functions x(t) and y(t).
Then you normalize, dividing the velocity vector by its length
sqrt((x'(t))2 + (y'(t))2).
The result is T.
Now it is especially easy to compute N since we are working in the plane. We use the following key fact, which we will use several other times too:
If (a,b) is any vector in the plane, then the vector (-b,a) is perpendicular to it
To see that this is true just take the dot product:
dot((a,b),(-b,a)) = -ab+ba = 0
This leads to the following definition:
Definition For any vector V = (a,b) the perped vector Vperp is defined by
Vperp = (-b,a)
This converts our formula for T (almost) into a formula for N, namely
N = (plus or minus) Tperp
The plus or minus is there because all we've made sure of is that this prescription gives us one of the normal directions, not necessarily the outward normal. So the final question is:
The best answer is: Draw a picture of the curve. Pick a point on it, i.e, pick a value of t, and compute Tperp for that value of t. Draw this on your graph, and see if it is pointing in or out. If what you've got is what you want, good. If not, use the minus sign.
This is the most practical approach. It is the least reliant on remembering anything. However, we can deduce whether to take plus or minus based on the orientation.
The following is not hard to check: If the path encloses the region counter-clockwise, then Tperp is the inward normal. On the other hand, if it encloses the region clockwise, then Tperp is the outward normal.
You can see this by observing that the "perp" operation rotates a vector through an angle of pi/2counter--clockwise. (Try the unit vectors (1,0) and (0,1) for example.