[−][src]Struct kurbo::Ellipse
An ellipse.
Implementations
impl Ellipse
[src]
pub fn new(
center: impl Into<Point>,
radii: impl Into<Vec2>,
x_rotation: f64
) -> Ellipse
[src]
center: impl Into<Point>,
radii: impl Into<Vec2>,
x_rotation: f64
) -> Ellipse
A new ellipse from center, radii, and x_rotation.
The returned ellipse will be the result of taking a circle, stretching it by the radii
along the x and y axes, then rotating it clockwise by x_rotation
radians, before finally
translating the center to center
.
pub fn from_rect(rect: Rect) -> Self
[src]
Returns the largest ellipse that can be bounded by this Rect
.
This uses the absolute width and height of the rectangle.
This ellipse is always axis-aligned; to apply rotation you can call
with_x_rotation
with the result.
pub fn from_affine(affine: Affine) -> Self
[src]
Create an ellipse from an affine transformation of the unit circle.
pub fn center(&self) -> Point
[src]
Returns the center of this ellipse.
pub fn with_center(self, new_center: Point) -> Ellipse
[src]
Sets the center of this ellipse.
pub fn radii(&self) -> Vec2
[src]
Returns the two radii of this ellipse.
The first number is the horizontal radius and the second is the vertical radius, before
rotating by x_rotation
.
#[must_use]pub fn with_radii(self, new_radii: Vec2) -> Ellipse
[src]
Set the radii of this ellipse.
pub fn x_rotation(&self) -> f64
[src]
The amount (in radians) that the ellipse should be rotated by (clockwise).
This allows all possible ellipses to be drawn by always starting with an ellipse with the two radii on the x and y axes.
pub fn with_x_rotation(self, new_x_rotation: f64) -> Ellipse
[src]
Set the amount (in radians) that the ellipse should be rotated by (clockwise).
Trait Implementations
impl Add<Vec2> for Ellipse
[src]
type Output = Ellipse
The resulting type after applying the +
operator.
fn add(self, v: Vec2) -> Ellipse
[src]
In this context adding a Vec2
applies the corresponding translation to the eliipse.
impl Clone for Ellipse
[src]
impl Copy for Ellipse
[src]
impl Debug for Ellipse
[src]
impl Default for Ellipse
[src]
impl<'de> Deserialize<'de> for Ellipse
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl From<Circle> for Ellipse
[src]
impl Mul<Ellipse> for Affine
[src]
type Output = Ellipse
The resulting type after applying the *
operator.
fn mul(self, other: Ellipse) -> Self::Output
[src]
impl PartialEq<Ellipse> for Ellipse
[src]
impl Serialize for Ellipse
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl Shape for Ellipse
[src]
type BezPathIter = Chain<Once<PathEl>, ArcAppendIter>
The iterator resulting from to_bez_path
.
fn to_bez_path(&self, tolerance: f64) -> Self::BezPathIter
[src]
fn area(&self) -> f64
[src]
fn perimeter(&self, accuracy: f64) -> f64
[src]
fn winding(&self, pt: Point) -> i32
[src]
fn bounding_box(&self) -> Rect
[src]
fn into_bez_path(self, tolerance: f64) -> BezPath
[src]
fn as_line(&self) -> Option<Line>
[src]
fn as_rect(&self) -> Option<Rect>
[src]
fn as_rounded_rect(&self) -> Option<RoundedRect>
[src]
fn as_circle(&self) -> Option<Circle>
[src]
fn as_path_slice(&self) -> Option<&[PathEl]>
[src]
impl StructuralPartialEq for Ellipse
[src]
impl Sub<Vec2> for Ellipse
[src]
Auto Trait Implementations
impl RefUnwindSafe for Ellipse
impl Send for Ellipse
impl Sync for Ellipse
impl Unpin for Ellipse
impl UnwindSafe for Ellipse
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,