Struct shape_core::Circle
source · #[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>where
T: Real + Clone,
impl<T> Circle<T>where T: Real + Clone,
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,
source§impl<T> Circle<T>where
T: Clone + Real + FloatConst + SampleUniform,
impl<T> Circle<T>where T: Clone + Real + FloatConst + SampleUniform,
pub fn random_point(&self, rng: impl Rng) -> Point<T>
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
source§impl<T: PartialEq> PartialEq for Circle<T>
impl<T: PartialEq> PartialEq for Circle<T>
impl<T: Copy> Copy for Circle<T>
impl<T: Eq> Eq for Circle<T>
impl<T> StructuralEq for Circle<T>
impl<T> StructuralPartialEq for Circle<T>
Auto Trait Implementations§
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