#[repr(C)]pub struct Ellipse {
pub center: Point2f,
pub radius_x: f32,
pub radius_y: f32,
}Expand description
Contains the center point, x-radius, and y-radius of an ellipse.
Fields§
§center: Point2fThe center point of the ellipse.
radius_x: f32The X-radius of the ellipse.
radius_y: f32The Y-radius of the ellipse.
Implementations§
Source§impl Ellipse
impl Ellipse
Sourcepub fn new(center: impl Into<Point2f>, rx: f32, ry: f32) -> Ellipse
pub fn new(center: impl Into<Point2f>, rx: f32, ry: f32) -> Ellipse
Constructs an ellipse from its components
Sourcepub fn contains_point(&self, point: impl Into<Point2f>) -> bool
pub fn contains_point(&self, point: impl Into<Point2f>) -> bool
Checks if an ellipse contains a point
Sourcepub fn contains_point_transformed(
&self,
transform: &Matrix3x2f,
point: impl Into<Point2f>,
) -> bool
pub fn contains_point_transformed( &self, transform: &Matrix3x2f, point: impl Into<Point2f>, ) -> bool
Determines if an ellipse which has a transform applied to it contains a specified (non- or pre-transformed) point.
Will always return false if !transform.is_invertible()
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Ellipse
impl<'de> Deserialize<'de> for Ellipse
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
impl Copy for Ellipse
impl StructuralPartialEq for Ellipse
Auto Trait Implementations§
impl Freeze for Ellipse
impl RefUnwindSafe for Ellipse
impl Send for Ellipse
impl Sync for Ellipse
impl Unpin for Ellipse
impl UnwindSafe for Ellipse
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