Quadratic

Type Alias Quadratic 

Source
pub type Quadratic = Poly<3>;
Expand description

A polynomial of degree 2.

Aliased Type§

pub struct Quadratic { /* private fields */ }

Implementations§

Source§

impl Quadratic

Source

pub fn roots(&self) -> ArrayVec<f64, 2>

Returns the roots of this quadratic, in increasing order.

Double-roots are only counted once.

Source

pub fn positive_discriminant_roots(&self) -> Option<(f64, f64)>

Returns the two distinct roots of this quadratic, but only if the discriminant is positive.