Bentley-Otmann Algorithm 2.0
An implementation of Bentley-Ottmann algorithm in order to count the m,n-cubes
|
Slope of a segment line. More...
#include <geometry.hpp>
Public Member Functions | |
void | make (const rat &, const rat &, const rat &, const rat &) |
Initializes a slope. | |
bool | operator< (const Slope &) const |
Defines an order on the slopes. | |
Public Attributes | |
slope_t | type |
Kind of slope. | |
rat | value |
if type = rational, value of that rational slope |
Slope of a segment line.
Definition at line 93 of file geometry.hpp.
void Slope::make | ( | const rat & | x0, |
const rat & | y0, | ||
const rat & | x1, | ||
const rat & | y1 | ||
) |
Initializes a slope.
x0,y0 | Left endpoint defining the slope |
x1,y1 | Right endpoint defining the slope |
Definition at line 41 of file geometry.cpp.
bool Slope::operator< | ( | const Slope & | s | ) | const |
Defines an order on the slopes.
s | Slope to compare with |
Slope with type 'infty' never are less than any other slope. If rational, the slope is less than an 'infty' one and follows the order on rational numbers for the general case.
Definition at line 61 of file geometry.cpp.