39 timeval temp_time_struct;
40 gettimeofday(&temp_time_struct,NULL);
41 srand(temp_time_struct.tv_usec);
45 int main(
int argc,
char **argv){
47 unsigned int runs = 400;
50 std::vector<double> xvalues(runs), yvalues(runs), zvalues(runs);
51 for (
unsigned int i = 0; i < runs ; i++ )
53 xvalues[i] = 1.0 * ((double) rand() - (double)RAND_MAX /2.0) /(double)RAND_MAX;
54 yvalues[i] = 1.0 * ((double) rand() - (double)RAND_MAX /2.0) /(double)RAND_MAX;
55 zvalues[i] = 1.0 * ((double) rand() - (double)RAND_MAX /2.0) /(double)RAND_MAX;
59 for (
unsigned int i = 0; i < runs ; i++ )
64 final = transform * initial;
65 std::printf(
"Useful Operator Overload: %f, angle between quaternions\n", initial.angle(
final));