REVOLUTIONSURFACE Create a surface of revolution from a planar curve.

   usage 
   [X Y Z] = revolutionSurface(C1, C2, N);
   create the surface of revolution of parametrized function (xt, yt),
   with N+1 equally spaced slices, around the Oz axis.
   It assumed that C1 corresponds to the x coordinate, and that C2
   corresponds to the Oz coordinate.

   [X Y Z] = revolutionSurface(CURVE, N);
   is the same, but generating curve is given in a single parameter CURVE,
   which is a [Nx2] array of 2D points.

   [X Y Z] = revolutionSurface(..., THETA)
   where THETA is a vector, uses values of THETA for computing revolution
   angles.

   [X Y Z] = revolutionSurface(..., LINE);
   where LINE is a 1x4 array, specifes the revolution axis in the
   coordinate system of the curve. LINE is a row vector of 4 parameters,
   containing [x0 y0 dx dy], where (x0,y0) is the origin of the line and
   (dx,dy) is a direction vector of the line.
   The resulting revolution surface still has Oz axis as symmetry axis. It
   can be transformed using transformPoint3d function.
   Surface can be displayed using :
   H = surf(X, Y, Z);
   H is a handle to the created patch.

   revolutionSurface(...);
   by itself, directly shows the created patch.

   Example
   % draws a piece of torus
   circle = circleAsPolygon([10 0 3], 50);
   [x y z] = revolutionSurface(circle, linspace(0, 4*pi/3, 50));
   surf(x, y, z);
   axis equal;



   See also
       surf, transformPoint3d, drawSphere, drawTorus, drawEllipsoid
       surfature (on Matlab File Exchange)


   ------
   Author: David Legland
   e-mail: david.legland@grignon.inra.fr
   Created: 2004-04-09
   Copyright 2005 INRA - CEPIA Nantes - MIAJ Jouy-en-Josas.

Package: matgeom