Isis 3 Programmer Reference
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
LineEquation()
Constructors.
Utility class for creating and using cartesean line equations.
Definition: LineEquation.h:44
double Intercept()
Compute the intercept of the line.
bool p_defined
Variable indicating if line is defined yet.
Definition: LineEquation.h:71
std::vector< double > p_y
Dependent variables.
Definition: LineEquation.h:70
void AddPoint(double x, double y)
Add a point to the object.
std::vector< double > p_x
Independent variables.
Definition: LineEquation.h:66
~LineEquation()
Destroys the LineEquation object.
Definition: LineEquation.h:51
bool p_interceptDefined
Variable indicating if intercept is defined yet.
Definition: LineEquation.h:73
bool p_slopeDefined
Variable indicating if slope is defined yet.
Definition: LineEquation.h:72
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
double Slope()
Compute the slope of the line.