59 total_weight += weight;
62 sigxx += x * x * weight;
63 sigxy += x * y * weight;
64 sigyy += y * y * weight;
68 total_weight += other.total_weight;
84 if (total_weight <= 0.0)
105 return covar / x_var;
118 if (total_weight > 0.0)
119 return (sigy -
m * sigx) / total_weight;
134 if (total_weight > 0) {
135 error = sigyy +
m * (
m * sigxx + 2 * (
c * sigx - sigxy)) +
c *
136 (total_weight *
c - 2 * sigy);
138 error = sqrt(error / total_weight);
160 if (var_product > 0.0)
161 r = covar / sqrt(var_product);
168 if (total_weight > 0.0) {
169 return FCOORD(sigx / total_weight, sigy / total_weight);
171 return FCOORD(0.0f, 0.0f);
256 double theta = 0.5 * atan2(2.0 * covar, x_var - y_var);
257 FCOORD result(cos(theta), sin(theta));
double covariance() const
double y_variance() const
double rms(double m, double c) const
double rms_orth(const FCOORD &dir) const
void add(double x, double y)
bool normalise()
Convert to unit vec.
double x_variance() const
void error(const char *caller, TessErrorLogCode action, const char *format,...) const
FCOORD vector_fit() const
FCOORD mean_point() const
void remove(double x, double y)