pub struct Circle<Coord: Coordinate2D + Coordinate> {
pub center: Coord,
pub radius: f64,
}Expand description
Represents a circle in 2 dimensions
Fields§
§center: CoordThe center of this circle
radius: f64The radius of this circle
Implementations§
Source§impl<Coord: Coordinate2D + Coordinate> Circle<Coord>
impl<Coord: Coordinate2D + Coordinate> Circle<Coord>
Sourcepub fn new(center: Coord, radius: f64) -> Circle<Coord>
pub fn new(center: Coord, radius: f64) -> Circle<Coord>
Creates a new circle with a center and a radius
Sourcepub fn arc(
&self,
start_radians: f64,
end_radians: f64,
) -> CircularArc<'_, Coord>
pub fn arc( &self, start_radians: f64, end_radians: f64, ) -> CircularArc<'_, Coord>
Returns an object representing an arc from this circle
Sourcepub fn to_curves<Curve: BezierCurveFactory<Point = Coord>>(&self) -> Vec<Curve>
pub fn to_curves<Curve: BezierCurveFactory<Point = Coord>>(&self) -> Vec<Curve>
Returns a set of bezier curves that approximate this circle
Sourcepub fn to_path<P: BezierPathFactory<Point = Coord>>(&self) -> P
pub fn to_path<P: BezierPathFactory<Point = Coord>>(&self) -> P
Returns a path that approximates this circle
Trait Implementations§
Source§impl<Coord: Clone + Coordinate2D + Coordinate> Clone for Circle<Coord>
impl<Coord: Clone + Coordinate2D + Coordinate> Clone for Circle<Coord>
impl<Coord: Copy + Coordinate2D + Coordinate> Copy for Circle<Coord>
Auto Trait Implementations§
impl<Coord> Freeze for Circle<Coord>where
Coord: Freeze,
impl<Coord> RefUnwindSafe for Circle<Coord>where
Coord: RefUnwindSafe,
impl<Coord> Send for Circle<Coord>where
Coord: Send,
impl<Coord> Sync for Circle<Coord>where
Coord: Sync,
impl<Coord> Unpin for Circle<Coord>where
Coord: Unpin,
impl<Coord> UnwindSafe for Circle<Coord>where
Coord: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more