Subversion Repositories gelsvn

Rev

Rev 5 | Rev 57 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5 Rev 12
1
#ifndef __CGLA_MAT2X3D_H
1
#ifndef __CGLA_MAT2X3D_H__
2
#define __CGLA_MAT2X3D_H
2
#define __CGLA_MAT2X3D_H__
3
 
3
 
4
#include "Vec2d.h"
4
#include "Vec2d.h"
5
#include "Vec3d.h"
5
#include "Vec3d.h"
6
#include "ArithMatFloat.h"
6
#include "ArithMatFloat.h"
7
 
7
 
8
namespace CGLA
8
namespace CGLA
9
{
9
{
10
 
10
 
11
	/**  2x3 float matrix class.
11
	/**  2x3 float matrix class.
12
			 This class is useful for projecting a vector from 3D space to 2D.
12
			 This class is useful for projecting a vector from 3D space to 2D.
13
	*/
13
	*/
14
	class Mat2x3d: public ArithMatFloat<Vec2d, Vec3d, Mat2x3d, 2>
14
	class Mat2x3d: public ArithMatFloat<Vec2d, Vec3d, Mat2x3d, 2>
15
	{
15
	{
16
 
16
 
17
	public:
17
	public:
18
		/// Construct Mat2x3d from two Vec3f vectors (vectors become rows)
18
		/// Construct Mat2x3d from two Vec3f vectors (vectors become rows)
19
		Mat2x3d(const Vec3d& _a, const Vec3d& _b): 
19
		Mat2x3d(const Vec3d& _a, const Vec3d& _b): 
20
			ArithMatFloat<Vec2d, Vec3d, Mat2x3d, 2> (_a,_b) {}
20
			ArithMatFloat<Vec2d, Vec3d, Mat2x3d, 2> (_a,_b) {}
21
 
21
 
22
		/// Construct 0 matrix.
22
		/// Construct 0 matrix.
23
		Mat2x3d() {}
23
		Mat2x3d() {}
24
 
24
 
25
		/// Construct matrix from array of values.
25
		/// Construct matrix from array of values.
26
		Mat2x3d(const double* sa): ArithMatFloat<Vec2d, Vec3d, Mat2x3d, 2> (sa) {}
26
		Mat2x3d(const double* sa): ArithMatFloat<Vec2d, Vec3d, Mat2x3d, 2> (sa) {}
27
	};
27
	};
28
 
28
 
29
	/**  3x2 float matrix class.
29
	/**  3x2 float matrix class.
30
			 This class is useful for going from plane to 3D coordinates.
30
			 This class is useful for going from plane to 3D coordinates.
31
	*/
31
	*/
32
	class Mat3x2f: public ArithMatFloat<Vec3d, Vec2d, Mat3x2f, 3>
32
	class Mat3x2f: public ArithMatFloat<Vec3d, Vec2d, Mat3x2f, 3>
33
	{
33
	{
34
 
34
 
35
	public:
35
	public:
36
 
36
 
37
		/** Construct matrix from three Vec2d vectors which become the 
37
		/** Construct matrix from three Vec2d vectors which become the 
38
				rows of the matrix. */
38
				rows of the matrix. */
39
		Mat3x2f(const Vec2d& _a, const Vec2d& _b, const Vec2d& _c): 
39
		Mat3x2f(const Vec2d& _a, const Vec2d& _b, const Vec2d& _c): 
40
			ArithMatFloat<Vec3d, Vec2d, Mat3x2f, 3> (_a,_b,_c) {}
40
			ArithMatFloat<Vec3d, Vec2d, Mat3x2f, 3> (_a,_b,_c) {}
41
 
41
 
42
		/// Construct 0 matrix.
42
		/// Construct 0 matrix.
43
		Mat3x2f() {}
43
		Mat3x2f() {}
44
 
44
 
45
		/// Construct matrix from array of values.
45
		/// Construct matrix from array of values.
46
		Mat3x2f(const double* sa): ArithMatFloat<Vec3d, Vec2d, Mat3x2f, 3> (sa) {}
46
		Mat3x2f(const double* sa): ArithMatFloat<Vec3d, Vec2d, Mat3x2f, 3> (sa) {}
47
 
47
 
48
	};
48
	};
49
 
49
 
50
 
50
 
51
}
51
}
52
#endif
52
#endif
53
 
53