Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

transform.h File Reference

#include "vec3.h"
#include "emobject.h"
#include <cstdio>

Include dependency graph for transform.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  EMAN

Classes

class  EMAN::Transform
 A Transform object is a somewhat specialized object designed specifically for EMAN2/Sparx storage of alignment parameters and euler orientations. More...

Defines

#define eman__transform_h__   1
 
Id
transform.h,v 1.174 2011/02/18 23:52:33 gtang Exp


Functions

Transform operator * (const Transform &M2, const Transform &M1)
 Matrix times Matrix, a pure mathematical operation.
template<typename Type>
Vec3f operator * (const Transform &M, const Vec3< Type > &v)
 Matrix times Vector, a pure mathematical operation.
template<typename Type>
Vec2f operator * (const Transform &M, const Vec2< Type > &v)
 Matrix times Vector, a pure mathematical operation.
template<typename Type>
Vec3f operator * (const Vec3< Type > &v, const Transform &M)
 Vector times a matrix.


Define Documentation

#define eman__transform_h__   1
 

Id
transform.h,v 1.174 2011/02/18 23:52:33 gtang Exp

Definition at line 38 of file transform.h.


Function Documentation

template<typename Type>
Vec3f operator * const Vec3< Type > &  v,
const Transform &  M
 

Vector times a matrix.

Highly specialized. Useful when the upper 3x3 only contains rotations and you want to quickly multiply by the rotation matrix inverse (transpose)

Definition at line 486 of file transform.h.

References v, EMAN::Vec3f, x, and y.

00487         {
00488                 float x = v[0] * M[0][0] + v[1] * M[1][0] + v[2] * M[2][0] ;
00489                 float y = v[0] * M[0][1] + v[1] * M[1][1] + v[2] * M[2][1];
00490                 float z = v[0] * M[0][2] + v[1] * M[1][2] + v[2] * M[2][2];
00491                 return Vec3f(x, y, z);
00492         }

template<typename Type>
Vec2f operator * const Transform &  M,
const Vec2< Type > &  v
 

Matrix times Vector, a pure mathematical operation.

Definition at line 477 of file transform.h.

References EMAN::Transform::transform(), v, and EMAN::Vec2f.

00478         {
00479                 return M.transform(v);
00480         }

template<typename Type>
Vec3f operator * const Transform &  M,
const Vec3< Type > &  v
 

Matrix times Vector, a pure mathematical operation.

Definition at line 470 of file transform.h.

References EMAN::Transform::transform(), v, and EMAN::Vec3f.

00471         {
00472                 return M.transform(v);
00473         }

Transform EMAN::operator * const Transform M2,
const Transform M1
 

Matrix times Matrix, a pure mathematical operation.

Definition at line 1159 of file transform.cpp.

01160 {
01161         Transform result;
01162         for (int i=0; i<3; i++) {
01163                 for (int j=0; j<4; j++) {
01164                         result[i][j] = M2[i][0] * M1[0][j] +  M2[i][1] * M1[1][j] + M2[i][2] * M1[2][j];
01165                 }
01166                 result[i][3] += M2[i][3];
01167         }
01168 
01169         return result;
01170 }


Generated on Thu Mar 10 22:59:35 2011 for EMAN2 by  doxygen 1.3.9.1