[][src]Struct math2d::Ellipse

#[repr(C)]
pub struct Ellipse { pub center: Point2f, pub radius_x: f32, pub radius_y: f32, }

Contains the center point, x-radius, and y-radius of an ellipse.

Fields

center: Point2f

The center point of the ellipse.

radius_x: f32

The X-radius of the ellipse.

radius_y: f32

The Y-radius of the ellipse.

Methods

impl Ellipse[src]

pub fn new(center: impl Into<Point2f>, rx: f32, ry: f32) -> Ellipse[src]

Constructs an ellipse from its components

pub fn contains_point(&self, point: impl Into<Point2f>) -> bool[src]

Checks if an ellipse contains a point

pub fn contains_point_transformed(
    &self,
    transform: &Matrix3x2f,
    point: impl Into<Point2f>
) -> bool
[src]

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

impl PartialEq<Ellipse> for Ellipse[src]

impl Default for Ellipse[src]

impl Clone for Ellipse[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<P> From<(P, f32, f32)> for Ellipse where
    P: Into<Point2f>, 
[src]

impl From<Ellipse> for D2D1_ELLIPSE[src]

impl From<D2D1_ELLIPSE> for Ellipse[src]

impl Copy for Ellipse[src]

impl Debug for Ellipse[src]

impl Serialize for Ellipse[src]

impl<'de> Deserialize<'de> for Ellipse[src]

Auto Trait Implementations

impl Send for Ellipse

impl Sync for Ellipse

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]