Struct shape_core::Ellipse
source · [−]Expand description
An ellipse defined by center and axes.
Fields
center: Point<T>
The center point of the ellipse.
radius: (T, T)
The axes of the ellipse.
rotate: T
The rotation of the ellipse.
Implementations
sourceimpl<T> Ellipse<T> where
T: Clone + Real + FloatConst,
impl<T> Ellipse<T> where
T: Clone + Real + FloatConst,
sourcepub fn new<P>(center: P, radius: (T, T), angle: T) -> Self where
P: Into<Point<T>>,
pub fn new<P>(center: P, radius: (T, T), angle: T) -> Self where
P: Into<Point<T>>,
Create a new ellipse with the center and the two axes and .
sourcepub fn from_coefficient(a: T, b: T, c: T, d: T, e: T, f: T) -> Self
pub fn from_coefficient(a: T, b: T, c: T, d: T, e: T, f: T) -> Self
Create a new ellipse with the coefficient of equation.
a x^2 + b y^2 + c xy + d x + e y + f = 0
sourceimpl<T> Ellipse<T> where
T: Zero + PartialEq,
impl<T> Ellipse<T> where
T: Zero + PartialEq,
sourcepub fn is_horizontal(&self) -> bool
pub fn is_horizontal(&self) -> bool
a / pi in Z
sourceimpl<T> Ellipse<T> where
T: Real,
impl<T> Ellipse<T> where
T: Real,
sourcepub fn major_axis(&self) -> &T
pub fn major_axis(&self) -> &T
Return the center of the ellipse.
sourcepub fn minor_axis(&self) -> &T
pub fn minor_axis(&self) -> &T
Get the minor axis of the ellipse.
sourcepub fn homogeneous(&self) -> (T, T, T, T, T, T)
pub fn homogeneous(&self) -> (T, T, T, T, T, T)
Return the homogeneous coefficients.
Ax^2 + 2Bxy + Cy^2 + 2Dx + 2Ey + F = 0
sourcepub fn coefficients(&self) -> (T, T, T, T, T, T)
pub fn coefficients(&self) -> (T, T, T, T, T, T)
Return the coefficients.
a x^2 + b xy + c y^2 + d x + e y + f = 0
sourcepub fn major_delta(&self) -> T
pub fn major_delta(&self) -> T
Get the major delta of the ellipse.
\Delta =
\begin{vmatrix}
A & B & D \\
B & C & E \\
D & E & F \\
\end{vmatrix}
= ACF+2BDE-AE^2-CD^2-FB^2
sourcepub fn minor_delta(&self) -> T
pub fn minor_delta(&self) -> T
Get the minor delta of the ellipse.
\delta =
\begin{vmatrix}
A & B \\
B & C \\
\end{vmatrix}
= AC - B^2
sourceimpl<T> Ellipse<T> where
T: Clone + Real + FromPrimitive + FloatConst,
impl<T> Ellipse<T> where
T: Clone + Real + FromPrimitive + FloatConst,
Trait Implementations
sourceimpl<'de, T> Deserialize<'de> for Ellipse<T> where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Ellipse<T> where
T: Deserialize<'de>,
sourcefn 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
sourceimpl<T> Projective<T> for Ellipse<T> where
T: Float + AddAssign,
impl<T> Projective<T> for Ellipse<T> where
T: Float + AddAssign,
sourcefn translate_x(&mut self, x: &T)
fn translate_x(&mut self, x: &T)
Transform by length $\delta x$. Read more
sourcefn translate_y(&mut self, y: &T)
fn translate_y(&mut self, y: &T)
Transform by length $\delta y$. Read more
impl<T: Copy> Copy for Ellipse<T>
impl<T: Eq> Eq for Ellipse<T>
impl<T> StructuralEq for Ellipse<T>
impl<T> StructuralPartialEq for Ellipse<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for Ellipse<T> where
T: RefUnwindSafe,
impl<T> Send for Ellipse<T> where
T: Send,
impl<T> Sync for Ellipse<T> where
T: Sync,
impl<T> Unpin for Ellipse<T> where
T: Unpin,
impl<T> UnwindSafe for Ellipse<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more