Struct rgeometry::data::PolygonConvex [−][src]
pub struct PolygonConvex<T>(_);
Implementations
$O(1)$ Assume that a polygon is convex.
Safety
The input polygon has to be strictly convex, ie. no vertices are allowed to be concave or colinear.
$O(\log n)$
pub fn random<R: ?Sized>(
n: usize,
max: usize,
rng: &mut R
) -> PolygonConvex<BigRational> where
R: Rng,
pub fn random<R: ?Sized>(
n: usize,
max: usize,
rng: &mut R
) -> PolygonConvex<BigRational> where
R: Rng,
$O(n \log n)$ Uniformly sample a random convex polygon.
The output polygon is centered at (0,0), and has a maximum width and height of 2 units.
PolygonConvex::random(3, 1000, &mut rand::thread_rng())Run
Methods from Deref<Target = Polygon<T>>
pub fn iter_boundary(&self) -> CursorIter<'_, T>ⓘNotable traits for CursorIter<'a, T>
impl<'a, T> Iterator for CursorIter<'a, T> type Item = Cursor<'a, T>;
pub fn iter_boundary_edges(&self) -> EdgeIter<'_, T>ⓘ
Panics if the edge isn’t part of the polygon.
Trait Implementations
Generate a random value of T
, using rng
as the source of randomness.
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl<T> RefUnwindSafe for PolygonConvex<T> where
T: RefUnwindSafe,
impl<T> Send for PolygonConvex<T> where
T: Send,
impl<T> Sync for PolygonConvex<T> where
T: Sync,
impl<T> Unpin for PolygonConvex<T> where
T: Unpin,
impl<T> UnwindSafe for PolygonConvex<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V