688 |
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.pd
|
|
|
5 |
* ----------------------------------------------------------------------- */
|
|
|
6 |
|
|
|
7 |
/** @file Mat2x2d.h
|
|
|
8 |
* @brief 2x2 double matrix class
|
|
|
9 |
*/
|
|
|
10 |
|
|
|
11 |
#ifndef __CGLA_MAT2X2D_H__
|
|
|
12 |
#define __CGLA_MAT2X2D_H__
|
|
|
13 |
|
|
|
14 |
#include "Vec2d.h"
|
|
|
15 |
#include "ArithSqMat2x2Float.h"
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
namespace CGLA {
|
|
|
19 |
|
|
|
20 |
/** \brief Two by two double matrix.
|
|
|
21 |
|
|
|
22 |
This class is useful for various
|
|
|
23 |
vector transformations in the plane. */
|
|
|
24 |
class Mat2x2d: public ArithSqMat2x2Float<Vec2d, Mat2x2d>
|
|
|
25 |
{
|
|
|
26 |
public:
|
|
|
27 |
|
|
|
28 |
/// Construct a Mat2x2d from two Vec2d vectors.
|
|
|
29 |
Mat2x2d(Vec2d a, Vec2d b): ArithSqMat2x2Float<Vec2d, Mat2x2d> (a,b) {}
|
|
|
30 |
|
|
|
31 |
/// Construct a Mat2x2f from four scalars.
|
|
|
32 |
Mat2x2d(double a, double b, double c, double d):
|
|
|
33 |
ArithSqMat2x2Float<Vec2d, Mat2x2d>(Vec2d(a,b),Vec2d(c,d)) {}
|
|
|
34 |
|
|
|
35 |
/// Construct the NAN matrix
|
|
|
36 |
Mat2x2d() {}
|
|
|
37 |
|
|
|
38 |
/// Construct a Mat2x2d from a single scalar
|
|
|
39 |
explicit Mat2x2d(double a):
|
|
|
40 |
ArithSqMat2x2Float<Vec2d, Mat2x2d>(a) {}
|
|
|
41 |
};
|
|
|
42 |
|
|
|
43 |
}
|
|
|
44 |
#endif
|