USGS

Isis 3.0 Object Programmers' Reference

Home

LineEquation.h
Go to the documentation of this file.
1 #ifndef LineEquation_h
2 #define LineEquation_h
3 
25 #include <vector>
26 
27 namespace Isis {
44  class LineEquation {
45  public:
47  LineEquation();
48  LineEquation(double x1, double y1, double x2, double y2);
49 
52  void AddPoint(double x, double y);
53  double Slope();
54  double Intercept();
55  int Points() {
56  return p_x.size();
57  };
58  bool HaveSlope() {
59  return p_slopeDefined;
60  };
61  bool HaveIntercept() {
62  return p_interceptDefined;
63  };
64  bool Defined() {
65  return p_defined;
66  };
67 
68  private:
69  std::vector<double> p_x;
70  std::vector<double> p_y;
71  bool p_defined;
74  double p_slope;
75  double p_intercept;
76 
77  }; // end of LineEquation class
78 }
79 #endif