Small class to keep a ratio (e.g. More...
#include <segment_ratio.hpp>
Public Types | |
typedef Type | numeric_type |
typedef segment_ratio< Type > | thistype |
Public Member Functions | |
segment_ratio () | |
segment_ratio (const Type &nominator, const Type &denominator) | |
Type const & | numerator () const |
Type const & | denominator () const |
void | assign (const Type &nominator, const Type &denominator) |
void | initialize () |
bool | is_zero () const |
bool | is_one () const |
bool | on_segment () const |
bool | in_segment () const |
bool | on_end () const |
bool | left () const |
bool | right () const |
bool | close_to (thistype const &other) const |
bool | operator< (thistype const &other) const |
bool | operator== (thistype const &other) const |
Static Public Member Functions | |
static thistype | zero () |
static thistype | one () |
Small class to keep a ratio (e.g.
1/4) Main purpose is intersections and checking on 0, 1, and smaller/larger The prototype used Boost.Rational. However, we also want to store FP ratios, (so numerator/denominator both in float) and Boost.Rational starts with GCD which we prefer to avoid if not necessary On a segment means: this ratio is between 0 and 1 (both inclusive)
typedef Type boost::geometry::segment_ratio< Type >::numeric_type |
typedef segment_ratio<Type> boost::geometry::segment_ratio< Type >::thistype |
|
inline |
|
inline |
|
inline |
|
inline |
References boost::geometry::math::abs().
Referenced by boost::geometry::segment_ratio< Type >::operator<(), and boost::geometry::segment_ratio< Type >::operator==().
|
inline |
Referenced by boost::geometry::segment_ratio< Type >::assign().
|
inline |
|
inline |
References boost::numeric_cast(), and boost::math::scale().
Referenced by boost::geometry::segment_ratio< Type >::assign(), and boost::geometry::segment_ratio< Type >::segment_ratio().
|
inline |
References boost::geometry::math::equals().
Referenced by boost::geometry::segment_ratio< Type >::on_end().
|
inline |
References boost::geometry::math::equals().
Referenced by boost::geometry::segment_ratio< Type >::on_end().
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inlinestatic |