søndag den 29. maj 2011

Extras

This is the code for the generating of the sinus table:



#include 
#include 
#include 
using namespace std;


float number = 34.453;
float counter = 0;

void sinusTableFunktion(float _counter, float _number)
{

  ofstream myfile;
  myfile.open ("sinusTable.txt" , ios::app);
  myfile << (int)_counter << "\t" << (int)_number << "\n";
   myfile.close();

}

void writeSinusTable()
{

 ofstream myfile;
  myfile.open ("sinusTable.txt" );
    myfile.close();

    for(int i = 0 ; i < 361 ; i++)
 {
  number = 512+(512*sin(counter/57.295779513082)); //   360/(PI*3)
  sinusTableFunktion(counter, number);
  counter++;
 }

}


void main()
{
 
 writeSinusTable();

}

Ingen kommentarer:

Send en kommentar