Struct spade::FloatKernel
[−]
[src]
pub struct FloatKernel {}
Offers a fast, precise kernel working with f64
coordinates.
Performing a delaunay triangulation is often a tradeoff between accuracy and speed:
a triangulation working on native f64
-operations will fail in rare cases due to rounding
errors, while switching to precise floats (like BigRationals
from the num
crate) reduces
performance by several orders of magnitude.
This kernel works with adaptive precision: if a calculation is inaccurate,
it will increase its precision until the result is accurate enough. Since most calculations
are accurate enough in their simplest form, only the overhead of checking the precision is
usually encountered. For more information, refer to
this link describing the techniques behind
the adaptive approach.
Trait Implementations
impl DelaunayKernel<f64> for FloatKernel
[src]
fn contained_in_circumference<V: TwoDimensional<Scalar=f64>>(v1: &V, v2: &V, v3: &V, p: &V) -> bool
Returns true if pd is contained in the circumference of the triangle spanned by pa, pb, pc. pa, pb, pc have to be ordered clockwise. Read more
fn side_query<V: TwoDimensional<Scalar=f64>>(edge: &SimpleEdge<V>, position: &V) -> EdgeSideInfo<f64>
Returns an EdgeSideInfo
yielding on which side of a line a point lies.
fn is_ordered_ccw<V: TwoDimensional<Scalar=D>>(v0: &V, v1: &V, v2: &V) -> bool
Another formulation of side_query
, will return true
if v0
, v1
and v2
are ordered counterclockwise. Read more
fn new_triangulation<T: HasPosition>() -> DelaunayTriangulation<T, Self> where T::Vector: TwoDimensional<Scalar=D>
Creates a new delaunay triangulation using this kernel.
fn point_on_edge<V: TwoDimensional<Scalar=D>>(edge: &SimpleEdge<V>, position: &V) -> bool
Returns if a point lies on the infinite edge going through edge.from
and edge.to
. Read more