This is scurve.c in view mode; [Download] [Up]
#include <stdio.h> #include <math.h> main( argc, argv ) int argc ; char *argv[] ; { int L, L3, i ; float x ; double PI = 4.*atan( 1.0 ) ; L = atoi( argv[1] + 2 ) ; L3 = L/3 ; for ( i = 0 ; i < L ; i++ ) { if ( i < L3 ) x = 0.5 - 0.5*cos( PI*i/( L3 - 1 ) ) ; else if ( i >= L3 && i < ( L - L3 ) ) x = 1.0 ; else x = 0.5 + 0.5*cos( PI*( i - ( L - L3 ) )/( L3 - 1 ) ) ; fwrite( &x, sizeof(float), 1, stdout ) ; } exit( 0 ) ; }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.