Go to the documentation of this file.00001
00002 #ifndef vdgl_OrthogRegress_h_
00003 #define vdgl_OrthogRegress_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include <vcl_cmath.h>
00014 #include <vdgl/vdgl_ortho_regress.h>
00015
00016 class vdgl_OrthogRegress : public vdgl_ortho_regress
00017 {
00018 double a_, b_, c_;
00019 double est_;
00020 public:
00021 typedef vdgl_ortho_regress base;
00022 vdgl_OrthogRegress() { }
00023 vdgl_OrthogRegress(double, double, double) { }
00024 void IncrByXY(double x, double y) { base::add_point(x, y); }
00025 void DecrByXY(double x, double y) { base::remove_point(x, y); }
00026 void Fit() { base::fit(a_, b_, c_); double r = vcl_sqrt(a_*a_ + b_*b_); a_/=r; b_/=r; c_/=r; }
00027 double GetA() const { return a_; }
00028 double GetB() const { return b_; }
00029 double GetC() const { return c_; }
00030 double GetCost() const { return base::cost(a_, b_, c_); }
00031 double GetEstCost() const { return est_; }
00032 void SetEstCost(double v) { est_ = v; }
00033 void Reset() { base::reset(); }
00034 };
00035
00036 #endif // vdgl_OrthogRegress_h_