Subversion Repositories gelsvn

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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