ccstruct/quadratc.h

Go to the documentation of this file.
00001 
00020 #ifndef           QUADRATC_H
00021 #define           QUADRATC_H
00022 
00023 #include          "points.h"
00024 
00029 class QUAD_COEFFS
00030 {
00031   public:
00032     QUAD_COEFFS() { 
00033     }                            //empty constructor
00034     QUAD_COEFFS(             //constructor
00035                 double xsq,  //coefficients
00036                 float x,
00037                 float constant) {
00038       a = xsq;
00039       b = x;
00040       c = constant;
00041     }
00042 
00043     float y(                  //evaluate
00044             float x) const {  //at x
00045       return (float) ((a * x + b) * x + c);
00046     }
00047 
00048     void move(               // reposition word
00049               ICOORD vec) {  // by vector
00058       INT16 p = vec.x ();
00059       INT16 q = vec.y ();
00060 
00061       c = (float) (c - b * p + a * p * p + q);
00062       b = (float) (b - 2 * a * p);
00063     }
00064 
00065     double a;                    //x squared
00066     float b;                     //x
00067     float c;                     //constant
00068   private:
00069 };
00070 #endif

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