Expand description
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.
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
source§impl From<D2D1_ELLIPSE> for Ellipse
impl From<D2D1_ELLIPSE> for Ellipse
source§fn from(e: D2D1_ELLIPSE) -> Ellipse
fn from(e: D2D1_ELLIPSE) -> Ellipse
Converts to this type from the input type.
source§impl From<Ellipse> for D2D1_ELLIPSE
impl From<Ellipse> for D2D1_ELLIPSE
source§fn from(e: Ellipse) -> D2D1_ELLIPSE
fn from(e: Ellipse) -> D2D1_ELLIPSE
Converts to this type from the input type.