geo_buffer/util/
mod.rs

1//! This module provides a conceptual structure of points and half-lines.
2//! 
3//! See more details on each item.
4
5mod coordinate;
6mod ray;
7
8pub use coordinate::Coordinate;
9pub use ray::Ray;
10
11const EPS: f64 = 1e-9;
12
13pub(crate) fn feq(x: f64, y: f64) -> bool{
14    f64::abs(x-y) < EPS
15}
16
17pub(crate) fn fneq(x: f64, y: f64) -> bool{
18    !feq(x, y)
19}
20
21pub(crate) fn fgt(x: f64, y: f64) -> bool{
22    if feq(x, y) {return false;}
23    x > y
24}
25
26#[allow(dead_code)]
27pub(crate) fn flt(x: f64, y: f64) -> bool{
28    if feq(x, y) {return false;}
29    x < y
30}
31
32pub(crate) fn fgeq(x: f64, y: f64) -> bool{
33    if feq(x, y) {return true;}
34    x > y
35}
36
37pub(crate) fn fleq(x: f64, y: f64) -> bool{
38    if feq(x, y) {return true;}
39    x < y
40}