tesseract 4.1.1
Loading...
Searching...
No Matches
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 25 of file quadratc.h.

Constructor & Destructor Documentation

◆ QUAD_COEFFS() [1/2]

QUAD_COEFFS::QUAD_COEFFS ( )
default

◆ QUAD_COEFFS() [2/2]

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

Definition at line 29 of file quadratc.h.

32 {
33 a = xsq;
34 b = x;
35 c = constant;
36 }
float b
Definition: quadratc.h:58
float c
Definition: quadratc.h:59
double a
Definition: quadratc.h:57

Member Function Documentation

◆ move()

void 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 }
int16_t y() const
access_function
Definition: points.h:56
int16_t x() const
access function
Definition: points.h:52

◆ y()

float 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 QUAD_COEFFS::a

Definition at line 57 of file quadratc.h.

◆ b

float QUAD_COEFFS::b

Definition at line 58 of file quadratc.h.

◆ c

float QUAD_COEFFS::c

Definition at line 59 of file quadratc.h.


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