pub struct QuadraticGraph2 {
pub a: Trig2,
pub b: Trig2,
pub c: Trig2,
pub branch: Branch,
}Expand description
The graph of one root of a(t) v^2 + b(t) v + c(t) = 0, parameterised by
its first coordinate: the point at t is (t, v(t)).
Where a vanishes the quadratic is linear and the branch that stays
finite is v = -c / b; the evaluation below is the rationalised form
v = 2c / (-b - sign sqrt(D)), which is finite there and free of the
cancellation -b + sqrt(D) suffers when 4ac is small.
The graph is only defined where D = b^2 - 4ac >= 0. Which spans those
are is decided when the graph is constructed (exactly, from the
operands’ own numbers) and carried by the edge interval that uses it;
evaluating outside them is refused, not extrapolated.
Fields§
§a: Trig2Coefficient of v^2.
b: Trig2Coefficient of v.
c: Trig2Constant coefficient.
branch: BranchWhich root.
Implementations§
Source§impl QuadraticGraph2
impl QuadraticGraph2
Sourcepub fn discriminant(&self, t: f64) -> f64
pub fn discriminant(&self, t: f64) -> f64
The discriminant b^2 - 4ac at t.
Sourcepub fn height(&self, t: f64) -> Option<f64>
pub fn height(&self, t: f64) -> Option<f64>
Height at t, or None where the root does not exist or diverges.
Trait Implementations§
Source§impl Clone for QuadraticGraph2
impl Clone for QuadraticGraph2
Source§fn clone(&self) -> QuadraticGraph2
fn clone(&self) -> QuadraticGraph2
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuadraticGraph2
impl Debug for QuadraticGraph2
Source§impl PartialEq for QuadraticGraph2
impl PartialEq for QuadraticGraph2
impl Copy for QuadraticGraph2
impl StructuralPartialEq for QuadraticGraph2
Auto Trait Implementations§
impl Freeze for QuadraticGraph2
impl RefUnwindSafe for QuadraticGraph2
impl Send for QuadraticGraph2
impl Sync for QuadraticGraph2
impl Unpin for QuadraticGraph2
impl UnwindSafe for QuadraticGraph2
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more