Subversion Repositories gelsvn

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 10
Line 12... Line 12...
12
float frand() { return static_cast<float>(rand())/RAND_MAX - 0.5f;}
12
float frand() { return static_cast<float>(rand())/RAND_MAX - 0.5f;}
13
 
13
 
14
/* This is a non-exhaustive test program for CGLA */
14
/* This is a non-exhaustive test program for CGLA */
15
main()
15
main()
16
{
16
{
17
	Vec3f norm(1,2,3);
17
	Vec3f norm(1,0,0);
18
	norm.normalize();
18
	norm.normalize();
19
 
19
 
20
	Vec3f a,b;
20
	Vec3f a,b;
21
 
21
 
22
	orthogonal(norm,a,b);
22
	orthogonal(norm,a,b);
Line 26... Line 26...
26
 
26
 
27
	vector<Vec3f> vec;
27
	vector<Vec3f> vec;
28
	srand(0);
28
	srand(0);
29
	for(int i=0;i<100000;++i)
29
	for(int i=0;i<100000;++i)
30
		{
30
		{
31
			Vec3f p = 1.0f*frand()*norm + 1.02f*frand()*a + 1.05f*frand()*b;
31
			Vec3f p = 1.0f*frand()*norm + 2.02f*frand()*a + 3.05f*frand()*b;
32
			vec.push_back(p);
32
			vec.push_back(p);
33
		}
33
		}
34
 
34
 
35
 
35
 
36
	Mat3x3f A;
36
	Mat3x3f A;