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 takes the root as c / q or
q / a with q = -(b + sign(b) sqrt(D)) / 2, which is finite there and
free of the cancellation either textbook form suffers (-b + sqrt(D)
when 4ac is small, -b - sqrt(D) when b has the other sign).
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: Scalar) -> Scalar
pub fn discriminant(&self, t: Scalar) -> Scalar
The discriminant b^2 - 4ac at t.
Sourcepub fn height(&self, t: Scalar) -> Option<Scalar>
pub fn height(&self, t: Scalar) -> Option<Scalar>
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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more