tesseract v5.3.3.20231005
tesseract::QUAD_COEFFS Class Reference

#include <quadratc.h>

Public Member Functions

 QUAD_COEFFS ()=default
 
 QUAD_COEFFS (double xsq, float x, float constant)
 
float y (float x) const
 
void move (ICOORD vec)
 

Public Attributes

double a
 
float b
 
float c
 

Detailed Description

Definition at line 27 of file quadratc.h.

Constructor & Destructor Documentation

◆ QUAD_COEFFS() [1/2]

tesseract::QUAD_COEFFS::QUAD_COEFFS ( )
default

◆ QUAD_COEFFS() [2/2]

tesseract::QUAD_COEFFS::QUAD_COEFFS ( double  xsq,
float  x,
float  constant 
)
inline

Definition at line 30 of file quadratc.h.

32 {
33 a = xsq;
34 b = x;
35 c = constant;
36 }

Member Function Documentation

◆ move()

void tesseract::QUAD_COEFFS::move ( ICOORD  vec)
inline

Definition at line 43 of file quadratc.h.

44 { // by vector
45 /************************************************************
46 y - q = a (x - p)^2 + b (x - p) + c
47 y - q = ax^2 - 2apx + ap^2 + bx - bp + c
48 y = ax^2 + (b - 2ap)x + (c - bp + ap^2 + q)
49************************************************************/
50 int16_t p = vec.x();
51 int16_t q = vec.y();
52
53 c = static_cast<float>(c - b * p + a * p * p + q);
54 b = static_cast<float>(b - 2 * a * p);
55 }
const char * p

◆ y()

float tesseract::QUAD_COEFFS::y ( float  x) const
inline

Definition at line 38 of file quadratc.h.

39 { // at x
40 return static_cast<float>((a * x + b) * x + c);
41 }

Member Data Documentation

◆ a

double tesseract::QUAD_COEFFS::a

Definition at line 57 of file quadratc.h.

◆ b

float tesseract::QUAD_COEFFS::b

Definition at line 58 of file quadratc.h.

◆ c

float tesseract::QUAD_COEFFS::c

Definition at line 59 of file quadratc.h.


The documentation for this class was generated from the following file: