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: 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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for QuadraticGraph2
Source§impl Debug for QuadraticGraph2
impl Debug for QuadraticGraph2
Source§impl<'de> Deserialize<'de> for QuadraticGraph2
impl<'de> Deserialize<'de> for QuadraticGraph2
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<QuadraticGraph2, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<QuadraticGraph2, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for QuadraticGraph2
impl PartialEq for QuadraticGraph2
Source§impl Serialize for QuadraticGraph2
impl Serialize for QuadraticGraph2
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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