Subversion Repositories gelsvn

Rev

Rev 89 | Go to most recent revision | 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.pdf
5
 * ----------------------------------------------------------------------- */
6
 
7
/** @file Mat2x2f.h
8
 * @brief 2x2 float matrix class
9
 */
10
 
12 jab 11
#ifndef __CGLA_MAT2X2F_H__
12
#define __CGLA_MAT2X2F_H__
2 bj 13
 
14
#include "Vec2f.h"
15
#include "ArithSqMat2x2Float.h"
16
 
17
 
12 jab 18
namespace CGLA 
19
{
2 bj 20
 
89 jab 21
  /** \brief Two by two float matrix. 
22
 
23
	This class is useful for various 
24
	vector transformations in the plane. */
12 jab 25
  class Mat2x2f: public ArithSqMat2x2Float<Vec2f, Mat2x2f>
26
    {
27
    public:
2 bj 28
 
12 jab 29
      /// Construct a Mat2x2f from two Vec2f vectors.
30
      Mat2x2f(Vec2f _a, Vec2f _b): ArithSqMat2x2Float<Vec2f, Mat2x2f> (_a,_b) {}
2 bj 31
 
12 jab 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)) {}
2 bj 35
 
12 jab 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) {}
2 bj 41
 
42
 
12 jab 43
    };
44
 
2 bj 45
}
46
#endif