Isis Developer Reference
LineEquation.h
Go to the documentation of this file.
1 #ifndef LineEquation_h
2 #define LineEquation_h
3 
8 /* SPDX-License-Identifier: CC0-1.0 */
9 
10 #include <vector>
11 
12 namespace Isis {
29  class LineEquation {
30  public:
32  LineEquation();
33  LineEquation(double x1, double y1, double x2, double y2);
34 
37  void AddPoint(double x, double y);
38  double Slope();
39  double Intercept();
40  int Points() {
41  return p_x.size();
42  };
43  bool HaveSlope() {
44  return p_slopeDefined;
45  };
46  bool HaveIntercept() {
47  return p_interceptDefined;
48  };
49  bool Defined() {
50  return p_defined;
51  };
52 
53  private:
54  std::vector<double> p_x;
55  std::vector<double> p_y;
56  bool p_defined;
57  bool p_slopeDefined;
58  bool p_interceptDefined;
59  double p_slope;
60  double p_intercept;
61 
62  }; // end of LineEquation class
63 }
64 #endif
Isis::LineEquation::HaveIntercept
bool HaveIntercept()
Definition: LineEquation.h:46
Isis::LineEquation::LineEquation
LineEquation()
Constructors.
Definition: LineEquation.cpp:19
Isis::LineEquation::HaveSlope
bool HaveSlope()
Definition: LineEquation.h:43
Isis::LineEquation::Intercept
double Intercept()
Compute the intercept of the line.
Definition: LineEquation.cpp:87
Isis::LineEquation::Defined
bool Defined()
Definition: LineEquation.h:49
Isis::LineEquation::Points
int Points()
Definition: LineEquation.h:40
Isis::LineEquation
Utility class for creating and using cartesean line equations.
Definition: LineEquation.h:29
IString.h
Isis::LineEquation::AddPoint
void AddPoint(double x, double y)
Add a point to the object.
Definition: LineEquation.cpp:51
LineEquation.h
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::LineEquation::~LineEquation
~LineEquation()
Destroys the LineEquation object.
Definition: LineEquation.h:36
Isis::IException
Isis exception class.
Definition: IException.h:91
IException.h
std
Namespace for the standard library.
Isis::Intercept
Container for a intercept condition.
Definition: Intercept.h:36
Isis::LineEquation::Slope
double Slope()
Compute the slope of the line.
Definition: LineEquation.cpp:66
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16