pub struct Integral<N, P: FreeSizePolynomial<N> + Evaluable<N>> { /* private fields */ }Expand description
A type which intreprets a polynomial as an integral, and ensures consistent use of the underlying polynomial as an integral.
Implementations§
Source§impl<N, P: FreeSizePolynomial<N> + Evaluable<N>> Integral<N, P>
impl<N, P: FreeSizePolynomial<N> + Evaluable<N>> Integral<N, P>
Source§impl<N: Sub<Output = N>, P: FreeSizePolynomial<N> + Evaluable<N>> Integral<N, P>
impl<N: Sub<Output = N>, P: FreeSizePolynomial<N> + Evaluable<N>> Integral<N, P>
Sourcepub fn eval(&self, start: N, end: N) -> N
pub fn eval(&self, start: N, end: N) -> N
Returns the area of the integral from the first point to the second point.
§Example
use rustnomial::{Polynomial, Integrable};
let polynomial = Polynomial::new(vec![2.0, 1.0]);
let integral = polynomial.integral();
assert_eq!(2.0, integral.eval(0.0, 1.0));
assert_eq!(6.0, integral.eval(0.0, 2.0));
assert_eq!(4.0, integral.eval(1.0, 2.0));Trait Implementations§
Source§impl<N, P: FreeSizePolynomial<N> + Evaluable<N> + SizedPolynomial<N> + Display> Display for Integral<N, P>
impl<N, P: FreeSizePolynomial<N> + Evaluable<N> + SizedPolynomial<N> + Display> Display for Integral<N, P>
Auto Trait Implementations§
impl<N, P> Freeze for Integral<N, P>where
P: Freeze,
impl<N, P> RefUnwindSafe for Integral<N, P>where
P: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, P> Send for Integral<N, P>
impl<N, P> Sync for Integral<N, P>
impl<N, P> Unpin for Integral<N, P>
impl<N, P> UnwindSafe for Integral<N, P>where
P: UnwindSafe,
N: UnwindSafe,
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
Mutably borrows from an owned value. Read more