667 |
khor |
1 |
/* ----------------------------------------------------------------------- *
|
|
|
2 |
* This file is part of GEL, http://www.imm.dtu.dk/GEL
|
|
|
3 |
* Copyright (C) the authors and DTU Informatics
|
|
|
4 |
* For license and list of authors, see ../../doc/intro.pdf
|
|
|
5 |
* ----------------------------------------------------------------------- */
|
|
|
6 |
|
|
|
7 |
/** @file Mat2x2f.h
|
|
|
8 |
* @brief 2x2 float matrix class
|
|
|
9 |
*/
|
|
|
10 |
|
|
|
11 |
#ifndef __CGLA_MAT2X2F_H__
|
|
|
12 |
#define __CGLA_MAT2X2F_H__
|
|
|
13 |
|
|
|
14 |
#include "Vec2f.h"
|
|
|
15 |
#include "ArithSqMat2x2Float.h"
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
namespace CGLA
|
|
|
19 |
{
|
|
|
20 |
|
|
|
21 |
/** \brief Two by two float matrix.
|
|
|
22 |
|
|
|
23 |
This class is useful for various
|
|
|
24 |
vector transformations in the plane. */
|
|
|
25 |
class Mat2x2f: public ArithSqMat2x2Float<Vec2f, Mat2x2f>
|
|
|
26 |
{
|
|
|
27 |
public:
|
|
|
28 |
|
|
|
29 |
/// Construct a Mat2x2f from two Vec2f vectors.
|
|
|
30 |
Mat2x2f(Vec2f _a, Vec2f _b): ArithSqMat2x2Float<Vec2f, Mat2x2f> (_a,_b) {}
|
|
|
31 |
|
|
|
32 |
/// Construct a Mat2x2f from four scalars.
|
|
|
33 |
Mat2x2f(float _a, float _b, float _c, float _d):
|
|
|
34 |
ArithSqMat2x2Float<Vec2f, Mat2x2f>(Vec2f(_a,_b),Vec2f(_c,_d)) {}
|
|
|
35 |
|
|
|
36 |
/// Construct the NAN matrix
|
|
|
37 |
Mat2x2f() {}
|
|
|
38 |
|
|
|
39 |
/// Construct a Mat2x2f from a single scalar
|
|
|
40 |
explicit Mat2x2f(float a): ArithSqMat2x2Float<Vec2f, Mat2x2f>(a) {}
|
|
|
41 |
|
|
|
42 |
|
|
|
43 |
};
|
|
|
44 |
|
|
|
45 |
}
|
|
|
46 |
#endif
|