[−][src]Struct sss_rs::geometry::term::Term
Represents a term in a polynomial function where the @co coefficient is multiplied by 'x' ^ @degree.
Methods
impl Term
[src]
pub fn new<T: Into<Fraction>>(co: T, degree: i32) -> Self
[src]
Creates a new Term with a given fraction and degree
pub fn get_degree(&self) -> i32
[src]
pub fn set_co(&mut self, co: Fraction)
[src]
pub fn get_co<'a>(&'a self) -> &'a Fraction
[src]
Return a reference to the coefficient of the term
pub fn term_add_same_degree(self, rhs: Term) -> Result<Term, ()>
[src]
This is a consuming operation that attempts to add two terms that have the same degree. NOTE: If the two terms do not have the same degree, only an error will be returned and the values dropped.
pub fn term_add(self, rhs: Term) -> Polynomial
[src]
Consuming add operation that adds two Terms together and returns a polynomial. Since the two terms may not have the same degree, they would have to become a polynomial.
pub fn term_sub(self, rhs: Term) -> Polynomial
[src]
Consuming sub operation that adds two Terms together and returns a polynomial. Since the two terms may not have the same degree, they would have to become a polynomial.
pub fn term_mul(self, rhs: Term) -> Term
[src]
Consuming multiplication operation, returns a Term since the multiplication of two single terms will always return a single term thus not needing to be a polynomial
pub fn term_mul_fraction<T: Into<Fraction>>(self, rhs: T) -> Self
[src]
Consuming multiplication operation which scales the term by a given fraction. This is equivalent to @term_mul with the second term having a @degree of 0
pub fn term_add_poly(self, rhs: Polynomial) -> Polynomial
[src]
Consuming add operation that adds a polynomial to a given term. These are conveience operations that allow for: Polynomai + Term and Term + Polynomial to give a communitive poperty.
pub fn term_sub_poly(self, rhs: Polynomial) -> Polynomial
[src]
See @term_add_poly
pub fn term_mul_poly(self, rhs: Polynomial) -> Polynomial
[src]
See @term_add_poly
Methods from Deref<Target = Fraction>
pub fn get_numerator(&self) -> i64
[src]
Returns a reference to the numerator of the fraction
pub fn get_denominator(&self) -> i64
[src]
Returns a reference to the denominator of the fraction
pub fn is_whole(&self) -> bool
[src]
Checks if the given fraction is a whole number, returns true if it is, false otherwise
Trait Implementations
impl AsRef<Fraction> for Term
[src]
impl From<Term> for Polynomial
[src]
impl Clone for Term
[src]
impl Default for Term
[src]
impl Eq for Term
[src]
impl Ord for Term
[src]
fn cmp(&self, other: &Term) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Term> for Term
[src]
impl PartialOrd<Term> for Term
[src]
fn partial_cmp(&self, other: &Term) -> Option<Ordering>
[src]
fn lt(&self, other: &Term) -> bool
[src]
fn le(&self, other: &Term) -> bool
[src]
fn gt(&self, other: &Term) -> bool
[src]
fn ge(&self, other: &Term) -> bool
[src]
impl Display for Term
[src]
impl Debug for Term
[src]
impl Sub<Term> for Term
[src]
type Output = Polynomial
The resulting type after applying the -
operator.
fn sub(self, rhs: Term) -> Self::Output
[src]
impl<'_> Sub<&'_ Term> for Term
[src]
type Output = Polynomial
The resulting type after applying the -
operator.
fn sub(self, rhs: &Term) -> Self::Output
[src]
impl<'_> Sub<Term> for &'_ Term
[src]
type Output = Polynomial
The resulting type after applying the -
operator.
fn sub(self, rhs: Term) -> Self::Output
[src]
impl<'_, '_> Sub<&'_ Term> for &'_ Term
[src]
type Output = Polynomial
The resulting type after applying the -
operator.
fn sub(self, rhs: &Term) -> Self::Output
[src]
impl Sub<Polynomial> for Term
[src]
type Output = Polynomial
The resulting type after applying the -
operator.
fn sub(self, rhs: Polynomial) -> Self::Output
[src]
impl<'_> Sub<&'_ Polynomial> for Term
[src]
type Output = Polynomial
The resulting type after applying the -
operator.
fn sub(self, rhs: &Polynomial) -> Self::Output
[src]
impl<'_> Sub<Polynomial> for &'_ Term
[src]
type Output = Polynomial
The resulting type after applying the -
operator.
fn sub(self, rhs: Polynomial) -> Self::Output
[src]
impl<'_, '_> Sub<&'_ Polynomial> for &'_ Term
[src]
type Output = Polynomial
The resulting type after applying the -
operator.
fn sub(self, rhs: &Polynomial) -> Self::Output
[src]
impl Add<Term> for Term
[src]
type Output = Polynomial
The resulting type after applying the +
operator.
fn add(self, rhs: Term) -> Self::Output
[src]
impl<'_> Add<&'_ Term> for Term
[src]
type Output = Polynomial
The resulting type after applying the +
operator.
fn add(self, rhs: &Term) -> Self::Output
[src]
impl<'_> Add<Term> for &'_ Term
[src]
type Output = Polynomial
The resulting type after applying the +
operator.
fn add(self, rhs: Term) -> Self::Output
[src]
impl<'_, '_> Add<&'_ Term> for &'_ Term
[src]
type Output = Polynomial
The resulting type after applying the +
operator.
fn add(self, rhs: &Term) -> Self::Output
[src]
impl Add<Polynomial> for Term
[src]
type Output = Polynomial
The resulting type after applying the +
operator.
fn add(self, rhs: Polynomial) -> Self::Output
[src]
impl<'_> Add<&'_ Polynomial> for Term
[src]
type Output = Polynomial
The resulting type after applying the +
operator.
fn add(self, rhs: &Polynomial) -> Self::Output
[src]
impl<'_> Add<Polynomial> for &'_ Term
[src]
type Output = Polynomial
The resulting type after applying the +
operator.
fn add(self, rhs: Polynomial) -> Self::Output
[src]
impl<'_, '_> Add<&'_ Polynomial> for &'_ Term
[src]
type Output = Polynomial
The resulting type after applying the +
operator.
fn add(self, rhs: &Polynomial) -> Self::Output
[src]
impl Mul<Term> for Term
[src]
type Output = Term
The resulting type after applying the *
operator.
fn mul(self, rhs: Term) -> Self::Output
[src]
impl<'_> Mul<&'_ Term> for Term
[src]
type Output = Term
The resulting type after applying the *
operator.
fn mul(self, rhs: &Term) -> Self::Output
[src]
impl<'_> Mul<Term> for &'_ Term
[src]
type Output = Term
The resulting type after applying the *
operator.
fn mul(self, rhs: Term) -> Self::Output
[src]
impl<'_, '_> Mul<&'_ Term> for &'_ Term
[src]
type Output = Term
The resulting type after applying the *
operator.
fn mul(self, rhs: &Term) -> Self::Output
[src]
impl Mul<Fraction> for Term
[src]
type Output = Term
The resulting type after applying the *
operator.
fn mul(self, rhs: Fraction) -> Self::Output
[src]
impl<'_> Mul<&'_ Fraction> for Term
[src]
type Output = Term
The resulting type after applying the *
operator.
fn mul(self, rhs: &Fraction) -> Self::Output
[src]
impl<'_> Mul<Fraction> for &'_ Term
[src]
type Output = Term
The resulting type after applying the *
operator.
fn mul(self, rhs: Fraction) -> Self::Output
[src]
impl<'_, '_> Mul<&'_ Fraction> for &'_ Term
[src]
type Output = Term
The resulting type after applying the *
operator.
fn mul(self, rhs: &Fraction) -> Self::Output
[src]
impl Mul<Polynomial> for Term
[src]
type Output = Polynomial
The resulting type after applying the *
operator.
fn mul(self, rhs: Polynomial) -> Self::Output
[src]
impl<'_> Mul<&'_ Polynomial> for Term
[src]
type Output = Polynomial
The resulting type after applying the *
operator.
fn mul(self, rhs: &Polynomial) -> Self::Output
[src]
impl<'_> Mul<Polynomial> for &'_ Term
[src]
type Output = Polynomial
The resulting type after applying the *
operator.
fn mul(self, rhs: Polynomial) -> Self::Output
[src]
impl<'_, '_> Mul<&'_ Polynomial> for &'_ Term
[src]
type Output = Polynomial
The resulting type after applying the *
operator.
fn mul(self, rhs: &Polynomial) -> Self::Output
[src]
impl Neg for Term
[src]
type Output = Self
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl<'_> Neg for &'_ Term
[src]
type Output = Term
The resulting type after applying the -
operator.
fn neg(self) -> Self::Output
[src]
impl Deref for Term
[src]
Auto Trait Implementations
impl Send for Term
impl Sync for Term
impl Unpin for Term
impl UnwindSafe for Term
impl RefUnwindSafe for Term
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,