Subversion Repositories gelsvn

Rev

Rev 12 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12 Rev 39
Line 16... Line 16...
16
{
16
{
17
	Vec3f norm(1,0,0);
17
    Vec3f norm(1,0,0);
18
	norm.normalize();
18
    norm.normalize();
19
 
19
    
20
	Vec3f a,b;
20
    Vec3f a,b;
21
 
-
 
22
	orthogonal(norm,a,b);
21
    orthogonal(norm,a,b);
23
 
22
    
24
	cout << "The frame " << endl;
23
    cout << "The frame " << endl;
25
	cout << norm << a << b << endl;
24
    cout << norm << a << b << endl;
26
 
25
    
Line 30... Line 29...
30
	  {
29
    {
31
	    Vec3f p = 1.0f*frand()*norm + 2.02f*frand()*a + 3.05f*frand()*b;
30
	Vec3f p = 1.0f*frand()*norm + 2.02f*frand()*a + 3.05f*frand()*b;
32
	    vec.push_back(p);
31
	vec.push_back(p);
33
	  }
32
    }
34
	
33
    
35
	
-
 
36
	Mat3x3f A(0);
34
    Mat3x3f A(0);
37
	Vec3f m = covariance(vec, A);
35
    Vec3f m = covariance(vec, A);
38
 
36
    
39
	cout << "Mean and covariance " << endl;
37
    cout << "Mean and covariance " << endl;
40
	cout << m << "\n" << A << endl;
38
    cout << m << "\n" << A << endl;