classify/xform2d.cpp

Go to the documentation of this file.
00001 
00020 /* =================
00021  Include Files and Type Defines
00022  ==================== */
00023 #include "xform2d.h"
00024 #include <math.h>
00025 
00026 /* =================
00027               Public Code
00028  ==================== */
00029 /* =============================== */
00051 void RotateMatrix(MATRIX_2D_PTR Matrix, FLOAT32 Angle) { 
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:10 2007 for Tesseract by  doxygen 1.5.1