classify/xform2d.cpp File Reference

#include "xform2d.h"
#include <math.h>

Go to the source code of this file.

Functions


Function Documentation

void RotateMatrix ( MATRIX_2D_PTR  Matrix,
FLOAT32  Angle 
)

Rotate the coordinate system (as specified by Matrix) about its origin by Angle radians.

Parameters:
Matrix Transformation matrix to rotate
Angle Angle to rotate matrix
Returns:
none (Matrix is modified)
In matrix notation the effect is as follows:
		Matrix = R X Matrix

	where R is the following matrix

    cos Angle   sin Angle   0
    -sin Angle  cos Angle   0
    0           0           1
Note:
Exceptions: none
Date:
7/27/89, DSJ, Create.

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 */


Generated on Wed Feb 28 19:49:21 2007 for Tesseract by  doxygen 1.5.1