pub struct Ellipse { /* private fields */ }Expand description
An ellipse in space.
Implementations§
Source§impl Ellipse
impl Ellipse
Sourcepub fn new(
frame: Frame,
major_radius: f64,
minor_radius: f64,
tol: Tolerances,
) -> OgeomResult<Self>
pub fn new( frame: Frame, major_radius: f64, minor_radius: f64, tol: Tolerances, ) -> OgeomResult<Self>
An ellipse with the given radii in the xy plane of frame, the major
radius along x.
§Errors
OgeomError::Construction if either
radius is not finite and positive, or if the minor radius exceeds the
major.
Sourcepub const fn major_radius(&self) -> f64
pub const fn major_radius(&self) -> f64
The major radius.
Sourcepub const fn minor_radius(&self) -> f64
pub const fn minor_radius(&self) -> f64
The minor radius.
Sourcepub fn focal_distance(&self) -> f64
pub fn focal_distance(&self) -> f64
The distance from the centre to either focus.
Sourcepub fn eccentricity(&self) -> f64
pub fn eccentricity(&self) -> f64
The eccentricity, in [0, 1). Zero for a circle.
Sourcepub fn length(&self) -> f64
pub fn length(&self) -> f64
The circumference.
Exact to machine precision, via the complete elliptic integral of the
second kind; see complete_elliptic_e.
Ramanujan’s well-known approximation was the obvious alternative and is
not good enough: it is excellent for a nearly circular ellipse but its
relative error reaches 1.2e-5 by an axis ratio of 10:1. Perimeter
feeds arc-length parameterization and measurement, where that is a
visible error rather than a rounding detail.
Sourcepub fn transformed(&self, t: &Transform, tol: Tolerances) -> OgeomResult<Self>
pub fn transformed(&self, t: &Transform, tol: Tolerances) -> OgeomResult<Self>
Trait Implementations§
impl Copy for Ellipse
impl StructuralPartialEq for Ellipse
Auto Trait Implementations§
impl Freeze for Ellipse
impl RefUnwindSafe for Ellipse
impl Send for Ellipse
impl Sync for Ellipse
impl Unpin for Ellipse
impl UnsafeUnpin for Ellipse
impl UnwindSafe for Ellipse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.