Expand description
A circle, defined by a center and radius.
Fields
center: Pt2D
radius: Distance
Implementations
sourceimpl Circle
impl Circle
sourcepub fn contains_pt(&self, pt: Pt2D) -> bool
pub fn contains_pt(&self, pt: Pt2D) -> bool
True if the point is inside the circle.
sourcepub fn get_bounds(&self) -> Bounds
pub fn get_bounds(&self) -> Bounds
Get the boundary containing this circle.
sourcepub fn to_polygon(&self) -> Polygon
pub fn to_polygon(&self) -> Polygon
Renders the circle as a polygon.
sourcepub fn to_partial_polygon(&self, percent_full: f64) -> Polygon
pub fn to_partial_polygon(&self, percent_full: f64) -> Polygon
Renders some percent, between [0, 1], of the circle as a polygon. The polygon starts from 0 degrees. Be warned the resulting polygon doesn’t have a ring as its boundary!
sourcepub fn to_outline(&self, thickness: Distance) -> Result<Polygon>
pub fn to_outline(&self, thickness: Distance) -> Result<Polygon>
Creates an outline around the circle, strictly contained with the circle’s original radius.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Circle
impl<'de> Deserialize<'de> for Circle
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Circle
impl Send for Circle
impl Sync for Circle
impl Unpin for Circle
impl UnwindSafe for Circle
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more