- #1
benjamin p north
- 2
- 0
I was hoping this c++ file could be adapted to use as data compression or encryption
Code:
#include <iostream>
#include <cmath>
using namespace std;
double asil(double t)
{
cout<<"asil\n";
cout<< cos(t) << endl;
double two = 2.0;
cout<< sin(sqrt(two)*t) << endl; return sin(sqrt(two)*t);
}
int main(){
double one = 1;
double four = 4;
double pi = atan(one)*four;
double tolerance = .00001;
//cout<<"dedede";
double m=1,n=1,t=1,x=1,y=1;
cout<<"enter x: " <<endl;
cin>>x;
cout<<"enter y: "<<endl;
cin>>y;
int i = 0;
while(
(sqrt(2)-tolerance)>((asin(y)+2*pi*m)/(acos(x)+2*pi*n))||
(sqrt(2)+tolerance)<((asin(y)+2*pi*m)/(acos(x)+2*pi*n)))
{
if(i++ % 100000 == 0) asil(t);
/**
if( ((sqrt(2)+0.0001)>=((asin(y)+2*pi*m)/(acos(x)+2*pi*n)))
&&((sqrt(2)-0.0001)<=((asin(y)+2*pi*m)/(acos(x)+2*pi*n))) ){ t=acos(x)+2*pi*n;
cout<<t<<endl;
}
else **/
if(
(sqrt(2)-tolerance)>=((asin(y)+2*pi*m)/(acos(x)+2*pi*n))){
m=m+1;}
else if((sqrt(2)+tolerance)<=((asin(y)+2*pi*m)/(acos(x)+2*pi*n)))
{
n=n+1;}
}
t=acos(x)+2*pi*n;
cout<<t<<endl;
asil(t);
return 0;
}
Last edited by a moderator: