Allolib
1.0
C++ Components For Interactive Multimedia
|
A closed interval [min, max]. More...
Public Member Functions | |
Interval (const T &min, const T &max) | |
T | center () const |
Returns center point. | |
bool | contains (const T &v) const |
Returns true if value is in interval. | |
bool | degenerate () const |
Returns true if diameter is zero. | |
T | diameter () const |
Returns absolute difference of endpoints. | |
T | size () const |
Returns absolute difference of endpoints. | |
const T & | max () const |
Get maximum endpoint. | |
const T & | min () const |
Get minimum endpoint. | |
bool | proper () const |
Returns true if diameter is non-zero. | |
T | radius () const |
Returns one-half the diameter. | |
T | toUnit (const T &v) const |
Linearly map point in interval to point in the unit interval. | |
template<class U > | |
bool | operator== (const Interval< U > &v) |
template<class U > | |
bool | operator!= (const Interval< U > &v) |
template<class U > | |
Interval & | operator+= (const Interval< U > &v) |
template<class U > | |
Interval & | operator-= (const Interval< U > &v) |
template<class U > | |
Interval & | operator*= (const Interval< U > &v) |
template<class U > | |
Interval & | operator/= (const Interval< U > &v) |
Interval & | center (const T &v) |
Set center point preserving diameter. | |
Interval & | diameter (const T &v) |
Set diameter (width) preserving center. | |
Interval & | centerDiameter (const T &c, const T &d) |
Set center and diameter. | |
Interval & | endpoints (const T &min, const T &max) |
Set the endpoints. | |
Interval & | translate (const T &v) |
Translate interval by fixed amount. | |
Interval & | max (const T &v) |
Set maximum endpoint. | |
Interval & | min (const T &v) |
Set minimum endpoint. | |
A closed interval [min, max].
An interval is a connected region of the real line. Geometrically, it describes a 0-sphere. Order is strongly enforced so that the endpoints will always satisfy min <= max.
Definition at line 55 of file al_Interval.hpp.
|
inline |
[in] | min | minimum endpoint |
[in] | max | maximum endpoint |
Definition at line 61 of file al_Interval.hpp.