Isis 3 Programmer Reference
LineEquation.h
1#ifndef LineEquation_h
2#define LineEquation_h
8/* SPDX-License-Identifier: CC0-1.0 */
9
10#include <vector>
11
12namespace Isis {
30 public:
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;
59 double p_slope;
60 double p_intercept;
61
62 }; // end of LineEquation class
63}
64#endif
Utility class for creating and using cartesean line equations.
bool p_interceptDefined
Variable indicating if intercept is defined yet.
double Slope()
Compute the slope of the line.
void AddPoint(double x, double y)
Add a point to the object.
bool p_slopeDefined
Variable indicating if slope is defined yet.
bool p_defined
Variable indicating if line is defined yet.
std::vector< double > p_x
Independent variables.
LineEquation()
Constructors.
~LineEquation()
Destroys the LineEquation object.
double Intercept()
Compute the intercept of the line.
std::vector< double > p_y
Dependent variables.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16