pub struct Polynomial {
pub constant: Duration,
pub rate: Duration,
pub accel: Duration,
}Expand description
Interpolation Polynomial used for example in [TimeScale] maintenance, precise monitoring or conversions.
Fields§
§constant: DurationConstant offset Duration, regardless of the interpolation interval
rate: DurationRate or drift in seconds per second (s.s⁻¹) expressed as Duration for convenience. It is a linear scaling factor of the interpolation interval.
accel: DurationAcceleration or drift change in s.s⁻², expressed as Duration for convenience. It is a quadratic scaling of the interpolation interval.
Implementations§
Source§impl Polynomial
impl Polynomial
Source§impl Polynomial
impl Polynomial
Sourcepub fn from_constant_offset(constant: Duration) -> Polynomial
pub fn from_constant_offset(constant: Duration) -> Polynomial
Create a Polynomial structure that is only made of a static offset
Sourcepub fn from_constant_offset_nanoseconds(nanos: f64) -> Polynomial
pub fn from_constant_offset_nanoseconds(nanos: f64) -> Polynomial
Create a Polynomial structure from a static offset expressed in nanoseconds
Sourcepub fn from_offset_and_rate(constant: Duration, rate: Duration) -> Polynomial
pub fn from_offset_and_rate(constant: Duration, rate: Duration) -> Polynomial
Create a Polynomial structure from both static offset and rate of change:
Sourcepub fn from_offset_rate_nanoseconds(
offset_ns: f64,
drift_ns_s: f64,
) -> Polynomial
pub fn from_offset_rate_nanoseconds( offset_ns: f64, drift_ns_s: f64, ) -> Polynomial
Create a Polynomial structure from a static offset and drift, in nanoseconds and nanoseconds.s⁻¹
Trait Implementations§
Source§impl Clone for Polynomial
impl Clone for Polynomial
Source§fn clone(&self) -> Polynomial
fn clone(&self) -> Polynomial
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Polynomial
impl Debug for Polynomial
Source§impl<'de> Deserialize<'de> for Polynomial
impl<'de> Deserialize<'de> for Polynomial
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Polynomial, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Polynomial, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for Polynomial
impl Display for Polynomial
Source§impl From<(f64, f64, f64)> for Polynomial
impl From<(f64, f64, f64)> for Polynomial
Source§fn from(triplet: (f64, f64, f64)) -> Polynomial
fn from(triplet: (f64, f64, f64)) -> Polynomial
Converts (f64, f64, f64) triplet, oftentimes noted (a0, a1, a2) as (offset (s), drift (s.s⁻¹), drift change (s.s⁻²)) to Polynomial structure, that allows precise [TimeScale] translation.
Source§impl Hash for Polynomial
impl Hash for Polynomial
Source§impl Ord for Polynomial
impl Ord for Polynomial
Source§fn cmp(&self, other: &Polynomial) -> Ordering
fn cmp(&self, other: &Polynomial) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Polynomial
impl PartialEq for Polynomial
Source§impl PartialOrd for Polynomial
impl PartialOrd for Polynomial
Source§impl Serialize for Polynomial
impl Serialize for Polynomial
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 Copy for Polynomial
impl Eq for Polynomial
impl StructuralPartialEq for Polynomial
Auto Trait Implementations§
impl Freeze for Polynomial
impl RefUnwindSafe for Polynomial
impl Send for Polynomial
impl Sync for Polynomial
impl Unpin for Polynomial
impl UnwindSafe for Polynomial
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FromDhall for Twhere
T: DeserializeOwned,
impl<T> FromDhall for Twhere
T: DeserializeOwned,
fn from_dhall(v: &Value) -> Result<T, Error>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.