Subversion Repositories gelsvn

Rev

Rev 595 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
595 jab 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
 
12 jab 11
#ifndef __CGLA_MAT2X2D_H__
12
#define __CGLA_MAT2X2D_H__
2 bj 13
 
14
#include "Vec2d.h"
15
#include "ArithSqMat2x2Float.h"
16
 
17
 
18
namespace CGLA {
19
 
89 jab 20
  /** \brief Two by two double matrix. 
21
 
22
	This class is useful for various 
23
	vector transformations in the plane. */
12 jab 24
  class Mat2x2d: public ArithSqMat2x2Float<Vec2d, Mat2x2d>
25
    {
26
    public:
2 bj 27
 
12 jab 28
      /// Construct a Mat2x2d from two Vec2d vectors.
29
      Mat2x2d(Vec2d a, Vec2d b): ArithSqMat2x2Float<Vec2d, Mat2x2d> (a,b) {}
2 bj 30
 
12 jab 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)) {}
2 bj 34
 
12 jab 35
      /// Construct the NAN matrix
36
      Mat2x2d() {}
2 bj 37
 
12 jab 38
      /// Construct a Mat2x2d from a single scalar
39
      explicit Mat2x2d(double a): 
40
	ArithSqMat2x2Float<Vec2d, Mat2x2d>(a) {}
41
    };
2 bj 42
 
43
}
44
#endif