58 total_weight += weight;
61 sigxx += x * x * weight;
62 sigxy += x * y * weight;
63 sigyy += y * y * weight;
67 total_weight += other.total_weight;
83 if (total_weight <= 0.0)
104 return covar / x_var;
117 if (total_weight > 0.0)
118 return (sigy -
m * sigx) / total_weight;
133 if (total_weight > 0) {
134 error = sigyy +
m * (
m * sigxx + 2 * (
c * sigx - sigxy)) +
c *
135 (total_weight *
c - 2 * sigy);
137 error = std::sqrt(error / total_weight);
159 if (var_product > 0.0)
160 r = covar / std::sqrt(var_product);
167 if (total_weight > 0.0) {
168 return FCOORD(sigx / total_weight, sigy / total_weight);
170 return FCOORD(0.0f, 0.0f);
255 double theta = 0.5 * atan2(2.0 * covar, x_var - y_var);
256 FCOORD result(cos(theta), sin(theta));
bool normalise()
Convert to unit vec.
void remove(double x, double y)
double covariance() const
void add(double x, double y)
FCOORD mean_point() const
double rms_orth(const FCOORD &dir) const
FCOORD vector_fit() const
double y_variance() const
double rms(double m, double c) const
double x_variance() const
void error(const char *caller, TessErrorLogCode action, const char *format,...) const