Isis 3 Programmer Reference
|
Utility class for creating and using cartesean line equations. More...
#include <LineEquation.h>
Public Member Functions | |
LineEquation () | |
Constructors. More... | |
LineEquation (double x1, double y1, double x2, double y2) | |
Construct and fill LineEquation object. More... | |
~LineEquation () | |
Destroys the LineEquation object. More... | |
void | AddPoint (double x, double y) |
Add a point to the object. More... | |
double | Slope () |
Compute the slope of the line. More... | |
double | Intercept () |
Compute the intercept of the line. More... | |
int | Points () |
bool | HaveSlope () |
bool | HaveIntercept () |
bool | Defined () |
Private Attributes | |
std::vector< double > | p_x |
Independent variables. More... | |
std::vector< double > | p_y |
Dependent variables. More... | |
bool | p_defined |
Variable indicating if line is defined yet. More... | |
bool | p_slopeDefined |
Variable indicating if slope is defined yet. More... | |
bool | p_interceptDefined |
Variable indicating if intercept is defined yet. More... | |
double | p_slope |
double | p_intercept |
Utility class for creating and using cartesean line equations.
This class contains utility methods for creating and using cartesean line equations. If both points have the same value for the independent variable (vertical line) an error is thrown.
Definition at line 44 of file LineEquation.h.
Isis::LineEquation::LineEquation | ( | ) |
Constructors.
Construct an empty LineEquation object.
Definition at line 35 of file LineEquation.cpp.
Isis::LineEquation::LineEquation | ( | double | x1, |
double | y1, | ||
double | x2, | ||
double | y2 | ||
) |
Construct and fill LineEquation object.
x1 | Double First independent variable |
y1 | Double First dependent variable |
x2 | Double Second independent variable |
y2 | Double Second dependent variable |
Definition at line 48 of file LineEquation.cpp.
|
inline |
Destroys the LineEquation object.
Definition at line 51 of file LineEquation.h.
void Isis::LineEquation::AddPoint | ( | double | x, |
double | y | ||
) |
Add a point to the object.
The object is considered filled once 2 points have been added (the line is defined).
x | Double Independent variable |
y | Double Dependent variable |
Definition at line 67 of file LineEquation.cpp.
References _FILEINFO_.
double Isis::LineEquation::Intercept | ( | ) |
Compute the intercept of the line.
Definition at line 103 of file LineEquation.cpp.
References _FILEINFO_.
Referenced by Isis::SpicePosition::SetPolynomial(), and Isis::SpiceRotation::SetPolynomial().
double Isis::LineEquation::Slope | ( | ) |
Compute the slope of the line.
Definition at line 82 of file LineEquation.cpp.
References _FILEINFO_.
Referenced by Isis::SpicePosition::SetPolynomial(), and Isis::SpiceRotation::SetPolynomial().
|
private |
Variable indicating if line is defined yet.
Definition at line 71 of file LineEquation.h.
|
private |
Variable indicating if intercept is defined yet.
Definition at line 73 of file LineEquation.h.
|
private |
Variable indicating if slope is defined yet.
Definition at line 72 of file LineEquation.h.
|
private |
Independent variables.
Definition at line 66 of file LineEquation.h.
|
private |
Dependent variables.
Definition at line 70 of file LineEquation.h.