Subversion Repositories gelsvn

Rev

Rev 5 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#ifndef __CGLA_MAT2X3D_H__
#define __CGLA_MAT2X3D_H__

#include "Vec2d.h"
#include "Vec3d.h"
#include "ArithMatFloat.h"

namespace CGLA
{

        /**  2x3 float matrix class.
                         This class is useful for projecting a vector from 3D space to 2D.
        */
        class Mat2x3d: public ArithMatFloat<Vec2d, Vec3d, Mat2x3d, 2>
        {

        public:
                /// Construct Mat2x3d from two Vec3f vectors (vectors become rows)
                Mat2x3d(const Vec3d& _a, const Vec3d& _b): 
                        ArithMatFloat<Vec2d, Vec3d, Mat2x3d, 2> (_a,_b) {}

                /// Construct 0 matrix.
                Mat2x3d() {}

                /// Construct matrix from array of values.
                Mat2x3d(const double* sa): ArithMatFloat<Vec2d, Vec3d, Mat2x3d, 2> (sa) {}
        };

        /**  3x2 float matrix class.
                         This class is useful for going from plane to 3D coordinates.
        */
        class Mat3x2f: public ArithMatFloat<Vec3d, Vec2d, Mat3x2f, 3>
        {

        public:

                /** Construct matrix from three Vec2d vectors which become the 
                                rows of the matrix. */
                Mat3x2f(const Vec2d& _a, const Vec2d& _b, const Vec2d& _c): 
                        ArithMatFloat<Vec3d, Vec2d, Mat3x2f, 3> (_a,_b,_c) {}

                /// Construct 0 matrix.
                Mat3x2f() {}

                /// Construct matrix from array of values.
                Mat3x2f(const double* sa): ArithMatFloat<Vec3d, Vec2d, Mat3x2f, 3> (sa) {}

        };


}
#endif