#include "fpoint.h"
Go to the source code of this file.
#define CopyMatrix | ( | A, | |||
B | ) |
#define InitMatrix | ( | M | ) |
Value:
((M)->a = 1, (M)->b = 0, \ (M)->c = 0, (M)->d = 1, \ (M)->tx = 0, (M)->ty = 0 )
Definition at line 44 of file xform2d.h.
Referenced by ComputeBulges().
#define MapDx | ( | M, | |||
DX, | |||||
DY | ) | ((M)->a * (DX) + (M)->c * (DY)) |
#define MapDy | ( | M, | |||
DX, | |||||
DY | ) | ((M)->b * (DX) + (M)->d * (DY)) |
#define MapPoint | ( | M, | |||
A, | |||||
B | ) |
#define MapX | ( | M, | |||
X, | |||||
Y | ) | ((M)->a * (X) + (M)->c * (Y) + (M)->tx) |
#define MapY | ( | M, | |||
X, | |||||
Y | ) | ((M)->b * (X) + (M)->d * (Y) + (M)->ty) |
#define MirrorMatrixInX | ( | M | ) | (ScaleMatrix((M),-1,1)) |
#define MirrorMatrixInXY | ( | M | ) | (ScaleMatrix((M),-1,-1)) |
#define MirrorMatrixInY | ( | M | ) | (ScaleMatrix((M),1,-1)) |
#define ScaleMatrix | ( | M, | |||
X, | |||||
Y | ) |
#define TranslateMatrix | ( | M, | |||
X, | |||||
Y | ) |
Value:
((M)->tx += (M)->a * (X) + (M)->c * (Y), \ (M)->ty += (M)->b * (X) + (M)->d * (Y) )
Definition at line 54 of file xform2d.h.
Referenced by ComputeBulges().
typedef struct MATRIX_2D * MATRIX_2D_PTR |
void RotateMatrix | ( | MATRIX_2D_PTR | Matrix, | |
FLOAT32 | Angle | |||
) |
Rotate the coordinate system (as specified by Matrix) about its origin by Angle radians.
Matrix | Transformation matrix to rotate | |
Angle | Angle to rotate matrix |
Matrix = R X Matrix where R is the following matrix cos Angle sin Angle 0 -sin Angle cos Angle 0 0 0 1
Definition at line 51 of file xform2d.cpp.
Referenced by ComputeBulges().
00051 { 00052 FLOAT32 Cos, Sin; 00053 FLOAT32 NewA, NewB; 00054 00055 Cos = cos ((double) Angle); 00056 Sin = sin ((double) Angle); 00057 00058 NewA = Matrix->a * Cos + Matrix->c * Sin; 00059 NewB = Matrix->b * Cos + Matrix->d * Sin; 00060 Matrix->c = Matrix->a * -Sin + Matrix->c * Cos; 00061 Matrix->d = Matrix->b * -Sin + Matrix->d * Cos; 00062 Matrix->a = NewA; 00063 Matrix->b = NewB; 00064 00065 } /* RotateMatrix */