[ create a new paste ] login | about

Link: http://codepad.org/Wwcygo40    [ raw code | fork ]

C, pasted on Jun 9:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
#include <math.h>


int main( void )
{
	FILE*	file = fopen( "circle.csv", "w" );

	if( file )
	{
		fprintf( file, "rad,x,y\n" );
		for( double rad = 0.0f; rad < (2 * 3.14); rad += 0.01 )
		{
			fprintf( file, "%lf,%lf,%lf\n", rad, 5.0 * sin(rad) + 1.0, 5.0 * cos(rad) + 2.5 );
		}
		fclose( file );
	}

	return 0;
}


Create a new paste based on this one


Comments: