Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Affine Matrix Library

Introduction

This is a document for Affine Matrix Library. Affine Matrix Library is a set of classes for affine matrix, which are necessary for 3D simulation.

Usage

Affine Matrix Library consist only from some header files. You can use this library just coping some header files (TAffine.h, TinyVec.h, TinyMat.h, TMatrix.h, TMatrixUtility.h, TVector.h) and including them from your .cpp files.

Sample

#include "Affine.h"							//	TAffine行列ライブラリのインクルードする.
#include <iostream>
	//	 Affine matrix class is declared in the name space of Spr.
		
void main(){
	Affinef af=Affinef::Rad(Rad(30), 'z');	//	Declare an Affine matrix of float element.
												
												Initializing as a matrix of rotation of 30 degrees around z axis.
												
												
	Vec3f vec(1,0,0);						//	Declare a vector of float element.
												
	std::cout << af;
	std::cout << vec << std::endl;
	std::cout << af * vec << std::endl;
}

Functions of Affine matrixs and vectors.

Normal calculations are supported.

Affine transformation is executed by:

	TAffine<float> af; TVec3<float> v, af_v;
	af_v = af * v;

You can extract some portion of the Affine matrix as:

You can assign portion of affine matrx.

	TAffine<float> af;
	af.Pos() = Vec3f(10,0,0);
	af.Rot() = TAffine<float>::Rot(Rad(30), 'x').Rot() * af.Rot();
a vector has following members.

Affine行列の初期化機能

TAffine行列(Spr::TAffine)には便利なコンストラクタや初期化関数を用意しました. いくつかをここで紹介します.

謝辞

LU分解,逆行列,ガウス消去法などの行列計算アルゴリズムは,
「『C言語による最新アルゴリズム事典』全ソースコード」
ftp://ftp.matsusaka-u.ac.jp/pub/algorithms
奥村 晴彦 Haruhiko Okumura
を改変して流用させていただきました. 自由にコードを使わせてくださって,ありがとうございます.
Generated on Sun Apr 16 02:07:53 2006 for Springhead by  doxygen 1.4.1