Isis Developer Reference
LineEquation.h
Go to the documentation of this file.
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 };
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
Utility class for creating and using cartesean line equations.
Definition LineEquation.h:29
double Slope()
Compute the slope of the line.
Definition LineEquation.cpp:66
void AddPoint(double x, double y)
Add a point to the object.
Definition LineEquation.cpp:51
bool HaveSlope()
Definition LineEquation.h:43
bool Defined()
Definition LineEquation.h:49
LineEquation()
Constructors.
Definition LineEquation.cpp:19
int Points()
Definition LineEquation.h:40
~LineEquation()
Destroys the LineEquation object.
Definition LineEquation.h:36
double Intercept()
Compute the intercept of the line.
Definition LineEquation.cpp:87
bool HaveIntercept()
Definition LineEquation.h:46
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16