7#include "LineEquation.h"
53 std::string msg =
"Line equation is already defined with 2 points";
54 throw IException(IException::Io, msg, _FILEINFO_);
68 std::string msg =
"Line equation undefined: 2 points are required";
69 throw IException(IException::Io, msg, _FILEINFO_);
71 else if(
p_x[0] ==
p_x[1]) {
72 std::string msg =
"Points have identical independent variables -- no slope";
73 throw IException(IException::Io, msg, _FILEINFO_);
89 std::string msg =
"Line equation undefined: 2 points are required";
90 throw IException(IException::Io, msg, _FILEINFO_);
92 else if(
p_x[0] ==
p_x[1]) {
93 std::string msg =
"Points have identical independent variables -- no intercept";
94 throw IException(IException::Io, msg, _FILEINFO_);
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.
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.
Namespace for the standard library.