#include <math.h>
#include <maya/MIOStream.h>
#include <maya/MSimple.h>
#include <maya/MFnNurbsCurve.h>
#include <maya/MPointArray.h>
#include <maya/MDoubleArray.h>
#include <maya/MPoint.h>
{
    const unsigned  deg     = 3;            
    const unsigned  ncvs    = 20;           
    const unsigned  spans   = ncvs - deg;   
    const unsigned  nknots  = spans+2*deg-1;
    double  radius          = 4.0;          
    double  pitch           = 0.5;          
    unsigned    i;
    
    for ( i = 0; i < args.
length(); i++ )
 
        {
            double tmp = args.
asDouble( ++i, &stat );
 
                pitch = tmp;
        }
        {
            double tmp = args.
asDouble( ++i, &stat );
 
                radius = tmp;
        }
    
    
    for (i = 0; i < ncvs; i++)
            pitch * (double)i, radius * sin( (double)i ) ) );
    for (i = 0; i < nknots; i++)
        knotSequences.
append( (
double)i );
    
    
    curveFn.
create( controlVertices,
                    knotSequences, deg, 
                    false, false, 
                    &stat );
        cout<<"Error creating curve."<<endl;
    return stat;
}