pub type Quadratic = Poly<3>;Expand description
A polynomial of degree 2.
Aliased Type§
pub struct Quadratic {
pub(crate) coeffs: [f64; 3],
}Fields§
§coeffs: [f64; 3]Implementations§
Source§impl Quadratic
impl Quadratic
Sourcepub fn roots(&self) -> ArrayVec<f64, 2>
pub fn roots(&self) -> ArrayVec<f64, 2>
Returns the roots of this quadratic, in increasing order.
Double-roots are only counted once.
Sourcepub fn positive_discriminant_roots(&self) -> Option<(f64, f64)>
pub fn positive_discriminant_roots(&self) -> Option<(f64, f64)>
Returns the two distinct roots of this quadratic, but only if the discriminant is positive.