-
Notifications
You must be signed in to change notification settings - Fork 2
/
RandomTest.cc
65 lines (46 loc) · 1.24 KB
/
RandomTest.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include "vector3d.h"
//#include "BoxCollision2.h"
#include <fstream>
#include <cmath>
#include <tuple>
#include <assert.h>
#include "RandomMove.h"
#include <chrono>
#include <iomanip>
#include <string>
#include <ctime>
using namespace std;
const int N = 5000;
int main()
{
ofstream file;
file.open("Output/EVRGauss2.txt");
double L = 1;
for(int n = 0; n < N; n++)
{
/*
double x,y,z;
do {
x = (RandomMove::randf() - 0.5)*2*L;
y = (RandomMove::randf() - 0.5)*2*L;
z = (RandomMove::randf() - 0.5)*2*L;
} while(sqrt(x*x + y*y + z*z) > L);
double length = sqrt(x*x + y*y + z*z);
x /= length;
y /= length;
z /= length;
file << x << "\t" << y << "\t" << z << endl;
*/
vector3d e0 (1,0,0);
vector3d output;
tuple<double, double, double, double> quaternion;
//do {
quaternion = RandomMove::randomQuaternion(1);
//} while(acos(get<0>(quaternion)) > 0.01);
output = RandomMove::rotateByQuaternion(e0, quaternion);
//tuple<double, double, double> eulerAngles = RandomMove::randomEulerAngles(1);
//output = RandomMove::rotateByEulerAngles(e0, eulerAngles);
file << output.x << "\t" << output.y << "\t" << output.z << endl;
}
}