Subversion Repositories gelsvn

Rev

Rev 2 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 12
Line 5... Line 5...
5
#include "Mat2x2f.h"
5
#include "Mat2x2f.h"
6
#include "Mat2x2d.h"
6
#include "Mat2x2d.h"
7
#include "CGLA.h"
7
#include "CGLA.h"
8
 
8
 
9
namespace CGLA {
9
namespace CGLA {
10
	using namespace std;
10
  using namespace std;
11
 
11
 
12
	template<class T, class V>
12
  template<class T, class V>
13
	bool linear_combine(const ArithVec2Float<T,V>& a,
13
  bool linear_combine(const ArithVec2Float<T,V>& a,
14
											const ArithVec2Float<T,V>& b,
14
		      const ArithVec2Float<T,V>& b,
15
											const ArithVec2Float<T,V>& c,
15
		      const ArithVec2Float<T,V>& c,
16
											T& x,
16
		      T& x,
17
											T& y) 
17
		      T& y) 
18
	{
18
  {
19
		Vec2d xy = invert(Mat2x2d(a[0],b[0],a[1],b[1])) * Vec2d(c[0], c[1]);
19
    Vec2d xy = invert(Mat2x2d(a[0],b[0],a[1],b[1])) * Vec2d(c[0], c[1]);
20
		x = xy[0];
20
    x = xy[0];
21
		y = xy[1];
21
    y = xy[1];
22
		return true;
22
    return true;
23
	}
23
  }
24
	
24
	
25
 
25
 
26
	template class ArithVec2Float<float, Vec2f>;
26
  template class ArithVec2Float<float, Vec2f>;
27
	template class ArithVec2Float<double, Vec2d>;
27
  template class ArithVec2Float<double, Vec2d>;
28
 
28
 
29
	template bool 
29
  template bool 
30
	linear_combine<double,Vec2d>(const ArithVec2Float<double,Vec2d>&,
30
  linear_combine<double,Vec2d>(const ArithVec2Float<double,Vec2d>&,
31
															 const ArithVec2Float<double,Vec2d>&,
31
			       const ArithVec2Float<double,Vec2d>&,
32
															 const ArithVec2Float<double,Vec2d>&,
32
			       const ArithVec2Float<double,Vec2d>&,
33
															 double&,
33
			       double&,
34
															 double&);
34
			       double&);
35
 
35
 
36
	template bool 
36
  template bool 
37
	linear_combine<float,Vec2f>(const ArithVec2Float<float,Vec2f>&,
37
  linear_combine<float,Vec2f>(const ArithVec2Float<float,Vec2f>&,
38
															const ArithVec2Float<float,Vec2f>&,
38
			      const ArithVec2Float<float,Vec2f>&,
39
															const ArithVec2Float<float,Vec2f>&,
39
			      const ArithVec2Float<float,Vec2f>&,
40
															float&,
40
			      float&,
41
															float&);
41
			      float&);
42
 
42
 
43
 
43
 
44
}
44
}