mod/maxgui.mod/fltkmaxgui.mod/src/freeglut_geometry.cxx
static void fghCircleTable(double **sint,double **cost,const int n)
{
    int i;

    /* Table size, the sign of n flips the circle direction */

    const int size = abs(n);

    /* Determine the angle between samples */

    const double angle = 2*M_PI/(double)( ( n == 0 ) ? 1 : n );

    /* Allocate memory for n samples, plus duplicate of first entry at the end */

    *sint = (double *) calloc(sizeof(double), size+1);
    *cost = (double *) calloc(sizeof(double), size+1);

    /* Bail out if memory allocation fails, fgError never returns */

    if (!(*sint) || !(*cost))
    {
      if (*sint) free(*sint);
      if (*cost) free(*cost);
      return;
    }

    /* Compute cos and sin around the circle */

    (*sint)[0] = 0.0;
    (*cost)[0] = 1.0;

    for (i=1; i<size; i++)
    {
        (*sint)[i] = sin(angle*i);
        (*cost)[i] = cos(angle*i);
    }

    /* Last sample is duplicate of the first */

    (*sint)[size] = (*sint)[0];
    (*cost)[size] = (*cost)[0];
}
/*
 * Compute lookup table of cos and sin values forming a cirle
 *
 * Notes:
 *    It is the responsibility of the caller to free these tables
 *    The size of the table is (n+1) to form a connected loop
 *    The last entry is exactly the same as the first
 *    The sign of n can be flipped to get the reverse loop
 */
Compute lookup table of cos and sin values forming a cirle
Notes:
It is the responsibility of the caller to free these tables
The size of the table is (n+1) to form a connected loop
The last entry is exactly the same as the first
The sign of n can be flipped to get the reverse loop
Compute lookup table of cos and sin values forming a cirle Notes : It is the responsibility of the caller to free these tables The size of the table is ( n + 1 ) to form a connected loop The last entry is exactly the same as the first The sign of n can be flipped to get the reverse loop
static void fghCircleTable(double **sint,double **cost,const int n)
{
    int i;
    const int size = abs(n);
    const double angle = 2*M_PI/(double)( ( n == 0 ) ? 1 : n );
    *sint = (double *) calloc(sizeof(double), size+1);
    *cost = (double *) calloc(sizeof(double), size+1);
    if (!(*sint) || !(*cost))
    {
      if (*sint) free(*sint);
      if (*cost) free(*cost);
      return;
    }
    (*sint)[0] = 0.0;
    (*cost)[0] = 1.0;
    for (i=1; i<size; i++)
    {
        (*sint)[i] = sin(angle*i);
        (*cost)[i] = cos(angle*i);
    }
    (*sint)[size] = (*sint)[0];
    (*cost)[size] = (*cost)[0];
}
static void fghCircleTable ( double * * sint , double * * cost , const int n ) { int i ; const int size = abs ( n ) ; const double angle = 2 * M_PI / ( double ) ( ( n == 0 ) ? 1 : n ) ; * sint = ( double * ) calloc ( sizeof ( double ) , size + 1 ) ; * cost = ( double * ) calloc ( sizeof ( double ) , size + 1 ) ; if ( ! ( * sint ) || ! ( * cost ) ) { if ( * sint ) free ( * sint ) ; if ( * cost ) free ( * cost ) ; return ; } ( * sint ) [ 0 ] = 0.0 ; ( * cost ) [ 0 ] = 1.0 ; for ( i = 1 ; i < size ; i ++ ) { ( * sint ) [ i ] = sin ( angle * i ) ; ( * cost ) [ i ] = cos ( angle * i ) ; } ( * sint ) [ size ] = ( * sint ) [ 0 ] ; ( * cost ) [ size ] = ( * cost ) [ 0 ] ; }
Compute lookup table of cos and sin values forming a cirle
 Notes:
    It is the responsibility of the caller to free these tables
    The size of the table is (n+1) to form a connected loop
    The last entry is exactly the same as the first
    The sign of n can be flipped to get the reverse loop
Compute lookup table of cos and sin values forming a cirle Notes : It is the responsibility of the caller to free these tables The size of the table is ( n + 1 ) to form a connected loop The last entry is exactly the same as the first The sign of n can be flipped to get the reverse loop
/* Table size, the sign of n flips the circle direction */ /* Determine the angle between samples */ /* Allocate memory for n samples, plus duplicate of first entry at the end */ /* Bail out if memory allocation fails, fgError never returns */ /* Compute cos and sin around the circle */ /* Last sample is duplicate of the first */