Isis Developer Reference
Isis::LineEquation Class Reference

Utility class for creating and using cartesean line equations. More...

#include <LineEquation.h>

Collaboration diagram for Isis::LineEquation:
Collaboration graph

Public Member Functions

 LineEquation ()
 Constructors.
 
 LineEquation (double x1, double y1, double x2, double y2)
 Construct and fill LineEquation object.
 
 ~LineEquation ()
 Destroys the LineEquation object.
 
void AddPoint (double x, double y)
 Add a point to the object.
 
double Slope ()
 Compute the slope of the line.
 
double Intercept ()
 Compute the intercept of the line.
 
int Points ()
 
bool HaveSlope ()
 
bool HaveIntercept ()
 
bool Defined ()
 

Detailed Description

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.

Author
2006-10-19 Debbie A. Cook

Constructor & Destructor Documentation

◆ LineEquation() [1/2]

Isis::LineEquation::LineEquation ( )

Constructors.

Construct an empty LineEquation object.

◆ LineEquation() [2/2]

Isis::LineEquation::LineEquation ( double x1,
double y1,
double x2,
double y2 )

Construct and fill LineEquation object.

Parameters
x1Double First independent variable
y1Double First dependent variable
x2Double Second independent variable
y2Double Second dependent variable

References AddPoint(), Intercept(), and Slope().

◆ ~LineEquation()

Isis::LineEquation::~LineEquation ( )
inline

Destroys the LineEquation object.

Member Function Documentation

◆ AddPoint()

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).

Parameters
xDouble Independent variable
yDouble Dependent variable

References _FILEINFO_, Isis::IException::Io, and Points().

Referenced by LineEquation().

◆ Defined()

bool Isis::LineEquation::Defined ( )
inline

◆ HaveIntercept()

bool Isis::LineEquation::HaveIntercept ( )
inline

◆ HaveSlope()

bool Isis::LineEquation::HaveSlope ( )
inline

◆ Intercept()

double Isis::LineEquation::Intercept ( )

Compute the intercept of the line.

Returns
double The y-intercept of the line if it exists

References _FILEINFO_, Isis::IException::Io, and Slope().

Referenced by LineEquation().

◆ Points()

int Isis::LineEquation::Points ( )
inline

Referenced by AddPoint().

◆ Slope()

double Isis::LineEquation::Slope ( )

Compute the slope of the line.

Returns
double The slope of the line if it exists

References _FILEINFO_, and Isis::IException::Io.

Referenced by Intercept(), and LineEquation().


The documentation for this class was generated from the following files: