pub struct Ellipse { /* private fields */ }
Expand description
The representation of a ellipse.
Implementations
sourceimpl Ellipse
impl Ellipse
sourcepub fn from_coefficient(
a: Float,
b: Float,
c: Float,
d: Float,
e: Float,
f: Float
) -> Self
pub fn from_coefficient(
a: Float,
b: Float,
c: Float,
d: Float,
e: Float,
f: Float
) -> 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 Ellipse
impl Ellipse
sourcepub fn major_axis(&self) -> Float
pub fn major_axis(&self) -> Float
Return the center of the ellipse.
sourcepub fn minor_axis(&self) -> Float
pub fn minor_axis(&self) -> Float
Get the minor axis of the ellipse.
sourcepub fn major_delta(&self) -> Float
pub fn major_delta(&self) -> Float
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) -> Float
pub fn minor_delta(&self) -> Float
Get the minor delta of the ellipse.
\delta =
\begin{vmatrix}
A & B \\
B & C \\
\end{vmatrix}
= AC - B^2
sourcepub fn rotate(&self) -> Float
pub fn rotate(&self) -> Float
Get the rotation of the ellipse.
\alpha=
\begin{cases}
\dfrac{1}{2}\arctan\dfrac{B}{A-C} &, A \ne C\\
\dfrac{\pi}{4} &, A = C\\
\end{cases}
sourcepub fn parameter(&self) -> (Float, Float, Float, Float, Float, Float)
pub fn parameter(&self) -> (Float, Float, Float, Float, Float, Float)
Return the parameters.
Ax^2+2Bxy+Cy^2+2Dx+2Ey+F=0
Trait Implementations
impl Copy for Ellipse
impl StructuralPartialEq for Ellipse
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
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)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more