#[repr(C)]pub struct Circle<T> {
pub center: Point<T>,
pub radius: T,
}
Expand description
A circle defined by center and radius.
Fields§
§center: Point<T>
The center points of the circle.
radius: T
The radius of the circle.
Implementations§
Source§impl<T> Circle<T>
impl<T> Circle<T>
Sourcepub fn with_center(center: Point<T>) -> Self
pub fn with_center(center: Point<T>) -> Self
Change circle center
Sourcepub fn with_radius(center: Point<T>, radius: T) -> Self
pub fn with_radius(center: Point<T>, radius: T) -> Self
Change circle radius
Sourcepub fn from_1_points(p1: &Point<T>) -> Self
pub fn from_1_points(p1: &Point<T>) -> Self
Create circle from center point and unknown radius
Sourcepub fn from_2_points(p1: &Point<T>, p2: &Point<T>) -> Self
pub fn from_2_points(p1: &Point<T>, p2: &Point<T>) -> Self
Create circle from two points on the diameter.
Sourcepub fn from_3_points(p1: &Point<T>, p2: &Point<T>, p3: &Point<T>) -> Self
pub fn from_3_points(p1: &Point<T>, p2: &Point<T>, p3: &Point<T>) -> Self
Create circle that intersects the 3 points.
Source§impl<T> Circle<T>where
T: Real + FloatConst,
impl<T> Circle<T>where
T: Real + FloatConst,
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Circle<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Circle<T>where
T: Deserialize<'de>,
Source§fn 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
Source§impl<T: Float> EuclideanDistance<T, Circle<T>> for Point<T>
impl<T: Float> EuclideanDistance<T, Circle<T>> for Point<T>
fn euclidean_distance(&self, rhs: &Circle<T>) -> T
Source§fn euclidean_squared(&self, rhs: &Circle<T>) -> T
fn euclidean_squared(&self, rhs: &Circle<T>) -> T
It is especially suitable when only the length needs to be compared Read more
impl<T: Copy> Copy for Circle<T>
impl<T: Eq> Eq for Circle<T>
impl<T> StructuralPartialEq for Circle<T>
Auto Trait Implementations§
impl<T> Freeze for Circle<T>where
T: Freeze,
impl<T> RefUnwindSafe for Circle<T>where
T: RefUnwindSafe,
impl<T> Send for Circle<T>where
T: Send,
impl<T> Sync for Circle<T>where
T: Sync,
impl<T> Unpin for Circle<T>where
T: Unpin,
impl<T> UnwindSafe for Circle<T>where
T: 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