Subversion Repositories gelsvn

Rev

Rev 595 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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