Struct adivon::primitive::RectHV
[−]
[src]
pub struct RectHV { pub xmin: f64, pub ymin: f64, pub xmax: f64, pub ymax: f64, }
Implementation of 2D axis-aligned rectangle
Fields
xmin: f64
ymin: f64
xmax: f64
ymax: f64
Methods
impl RectHV
[src]
fn new(xmin: f64, ymin: f64, xmax: f64, ymax: f64) -> RectHV
fn width(&self) -> f64
fn height(&self) -> f64
fn contains<T: Borrow<Point2D>>(&self, p: T) -> bool
fn intersects<T: Borrow<RectHV>>(&self, that: T) -> bool
does this axis-aligned rectangle intersect that one?
fn distance_to<T: Borrow<Point2D>>(&self, p: T) -> f64
distance from p to closest point on this axis-aligned rectangle
fn distance_squared_to<T: Borrow<Point2D>>(&self, p: T) -> f64
distance squared from p to closest point on this axis-aligned rectangle
Trait Implementations
impl Clone for RectHV
[src]
fn clone(&self) -> RectHV
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for RectHV
[src]
impl PartialEq for RectHV
[src]
fn eq(&self, __arg_0: &RectHV) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &RectHV) -> bool
This method tests for !=
.
impl PartialOrd for RectHV
[src]
fn partial_cmp(&self, __arg_0: &RectHV) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &RectHV) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &RectHV) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &RectHV) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &RectHV) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more