Updraft  1.0
Open source glider flight visualisation tool.
Updraft::Util::LinearFunc Class Reference

Class representing a linear function. More...

#include <linearfunc.h>

List of all members.

Public Member Functions

 LinearFunc ()
 LinearFunc (qreal slope, qreal yIntercept)
 LinearFunc (qreal x0, qreal y0, qreal x1, qreal y1)
 Set the linear function to have value y0 in x0 and y1 in x1.
void set (qreal slope, qreal yIntercept)
void set (qreal x0, qreal y0, qreal x1, qreal y1)
 Set the linear function to have value y0 in x0 and y1 in x1.
LinearFunc compose (const LinearFunc &other) const
 Return a composed linear function corresponding to this->get(other->get(x))
qreal get (qreal x) const
 Return the value of function in x.
qreal inverse (qreal y) const
 Return the value of x when the function has the value y.

Protected Attributes

qreal a
qreal b

Detailed Description

Class representing a linear function.

Just a convenience to avoid keeping two qreals all the time.


Constructor & Destructor Documentation

Updraft::Util::LinearFunc::LinearFunc ( qreal  slope,
qreal  yIntercept 
) [inline]
Updraft::Util::LinearFunc::LinearFunc ( qreal  x0,
qreal  y0,
qreal  x1,
qreal  y1 
) [inline]

Set the linear function to have value y0 in x0 and y1 in x1.


Member Function Documentation

LinearFunc Updraft::Util::LinearFunc::compose ( const LinearFunc other) const [inline]

Return a composed linear function corresponding to this->get(other->get(x))

qreal Updraft::Util::LinearFunc::get ( qreal  x) const [inline]

Return the value of function in x.

qreal Updraft::Util::LinearFunc::inverse ( qreal  y) const [inline]

Return the value of x when the function has the value y.

void Updraft::Util::LinearFunc::set ( qreal  slope,
qreal  yIntercept 
) [inline]
void Updraft::Util::LinearFunc::set ( qreal  x0,
qreal  y0,
qreal  x1,
qreal  y1 
) [inline]

Set the linear function to have value y0 in x0 and y1 in x1.


Member Data Documentation

qreal Updraft::Util::LinearFunc::a [protected]
qreal Updraft::Util::LinearFunc::b [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines