Skip to main content

AngularMomentum

Struct AngularMomentum 

Source
pub struct AngularMomentum(/* private fields */);
Expand description

Angular momentum [kg·m²/s].

Implementations§

Source§

impl AngularMomentum

Source

pub fn from_ex(ex: impl IntoEx) -> Self

Create from a symbolic expression (or anything that implements IntoEx).

Source

pub fn checked_from_ex(ex: impl IntoEx, dims: &DimMap) -> Result<Self, String>

Create from a symbolic expression with runtime dimension validation.

Checks that the expression’s inferred dimension matches this type’s dimension using the provided DimMap. Returns an error if the dimensions don’t match.

Use this instead of from_ex when you want runtime validation of dimensional correctness (e.g., in tests or debug builds).

Source

pub fn symbol(ctx: &Context, name: &str) -> Self

Create a named symbolic variable with this dimension.

Source

pub fn constant(ctx: &Context, val: i64) -> Self

Create from an integer constant.

Source

pub fn rational(ctx: &Context, p: i64, q: i64) -> Self

Create from a rational constant.

Source

pub fn zero(ctx: &Context) -> Self

Zero value.

Source

pub fn into_inner(self) -> Ex

Escape hatch: drop dimension, return raw Ex.

Source

pub fn inner(&self) -> &Ex

Borrow the inner Ex.

Source

pub fn as_qty(self) -> Qty<AngularMomentumDim>

Convert to generic Qty<D>.

Source

pub fn dim_name_str() -> &'static str

Runtime dimension name.

Source

pub fn dim_symbol_str() -> &'static str

Runtime dimension symbol.

Source

pub fn simplify(&self) -> Self

Apply simplify, preserving dimension.

Source

pub fn expand(&self) -> Self

Apply expand, preserving dimension.

Source

pub fn eval(&self) -> Self

Apply eval, preserving dimension.

Source

pub fn subs(&self, var: &impl AsRef<Ex>, val: &impl AsRef<Ex>) -> Self

Substitute a variable.

Source

pub fn simplify_full(&self) -> Self

Full multi-pass simplification, preserving dimension.

Source

pub fn simplify_trig(&self) -> Self

Trigonometric simplification, preserving dimension.

Source

pub fn simplify_powers(&self) -> Self

Power/exponent simplification, preserving dimension.

Source

pub fn simplify_rational(&self) -> Self

Rational simplification, preserving dimension.

Source

pub fn expand_trig(&self) -> Self

Expand trigonometric identities, preserving dimension.

Source

pub fn expand_log(&self) -> Self

Expand logarithmic identities, preserving dimension.

Source

pub fn log_combine(&self) -> Self

Combine logarithmic terms, preserving dimension.

Source

pub fn trig_combine(&self) -> Self

Combine trigonometric terms, preserving dimension.

Source

pub fn factor(&self, var: &impl AsRef<Ex>) -> Self

Factor with respect to a variable, preserving dimension.

Source

pub fn collect(&self, var: &impl AsRef<Ex>) -> Self

Collect terms with respect to a variable, preserving dimension.

Source

pub fn cancel(&self, var: &Ex) -> Self

Cancel common factors, preserving dimension.

Source

pub fn together(&self) -> Self

Combine fractions over a common denominator, preserving dimension.

Source

pub fn partial_fractions(&self, var: &impl AsRef<Ex>) -> Self

Partial-fraction decomposition with respect to a variable, preserving dimension.

Source

pub fn rationalize_denom(&self) -> Self

Rationalize the denominator, preserving dimension.

Source

pub fn diff(&self, var: &impl AsRef<Ex>) -> Ex

Differentiate with respect to a variable. Returns raw Ex. Wrap result in the correct output type: Acceleration::from_ex(v.diff(&t))

Source

pub fn integrate(&self, var: &impl AsRef<Ex>) -> Ex

Integrate with respect to a variable. Returns raw Ex.

Source

pub fn to_latex(&self) -> String

Render as LaTeX string.

Source

pub fn free_symbols(&self) -> Vec<Ex>

Free symbols in the expression.

Source

pub fn contains(&self, other: &impl AsRef<Ex>) -> bool

Whether the expression contains a given sub-expression.

Source

pub fn term_count(&self) -> usize

Number of top-level additive terms.

Source

pub fn count_ops(&self) -> usize

Count of internal operations.

Source

pub fn is_zero(&self) -> bool

Check whether this quantity is provably zero.

Source

pub fn equals(&self, other: &Self) -> bool

Check symbolic equality with another quantity of the same type.

Source

pub fn eval_f64(&self) -> Result<f64, SymplexError>

Evaluate to f64.

Source

pub fn eval_f64_with(&self, subs: &[(&Ex, i64)]) -> Result<f64, SymplexError>

Substitute integer values and evaluate to f64.

Source

pub fn eval_decimal(&self, digits: u32) -> Result<String, SymplexError>

Evaluate to a decimal string with the given number of digits.

Trait Implementations§

Source§

impl Add for AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the + operator.
Source§

fn add(self, rhs: AngularMomentum) -> AngularMomentum

Performs the + operation. Read more
Source§

impl Add<&AngularMomentum> for &AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &AngularMomentum) -> AngularMomentum

Performs the + operation. Read more
Source§

impl Add<&AngularMomentum> for AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &AngularMomentum) -> AngularMomentum

Performs the + operation. Read more
Source§

impl Add<AngularMomentum> for &AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the + operator.
Source§

fn add(self, rhs: AngularMomentum) -> AngularMomentum

Performs the + operation. Read more
Source§

impl AsRef<Expr<Numeric>> for AngularMomentum

Source§

fn as_ref(&self) -> &Ex

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for AngularMomentum

Source§

fn clone(&self) -> AngularMomentum

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AngularMomentum

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl DiffWrt<Angle> for AngularMomentum

Source§

type Output = AngularMomentum

The output quantity type after differentiation.
Source§

fn diff_wrt(&self, var: &Angle) -> AngularMomentum

Differentiate this quantity with respect to the given variable.
Source§

impl DiffWrt<Time> for AngularMomentum

Source§

type Output = Torque

The output quantity type after differentiation.
Source§

fn diff_wrt(&self, var: &Time) -> Torque

Differentiate this quantity with respect to the given variable.
Source§

impl Display for AngularMomentum

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Div<i64> for AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i64) -> AngularMomentum

Performs the / operation. Read more
Source§

impl From<AngularMomentum> for Qty<AngularMomentumDim>

Source§

fn from(q: AngularMomentum) -> Qty<AngularMomentumDim>

Converts to this type from the input type.
Source§

impl From<Qty<Dim<PInt<UInt<UInt<UTerm, B1>, B0>>, PInt<UInt<UTerm, B1>>, NInt<UInt<UTerm, B1>>, Z0, Z0, Z0, Z0>>> for AngularMomentum

Source§

fn from(q: Qty<AngularMomentumDim>) -> AngularMomentum

Converts to this type from the input type.
Source§

impl FromDimExpr<Dim<PInt<UInt<UInt<UTerm, B1>, B0>>, PInt<UInt<UTerm, B1>>, NInt<UInt<UTerm, B1>>, Z0, Z0, Z0, Z0>> for AngularMomentum

Source§

fn from_dim_expr(qty: Qty<AngularMomentumDim>) -> Self

Convert from a generic Qty with the matching dimension.
Source§

impl IntWrt<Angle> for AngularMomentum

Source§

type Output = AngularMomentum

The output quantity type after integration.
Source§

fn integrate_wrt(&self, var: &Angle) -> AngularMomentum

Integrate this quantity with respect to the given variable.
Source§

impl IntWrt<AngularVelocity> for AngularMomentum

Source§

type Output = Energy

The output quantity type after integration.
Source§

fn integrate_wrt(&self, var: &AngularVelocity) -> Energy

Integrate this quantity with respect to the given variable.
Source§

impl Mul<&AngularMomentum> for i64

Source§

type Output = AngularMomentum

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &AngularMomentum) -> AngularMomentum

Performs the * operation. Read more
Source§

impl Mul<&Expr<Numeric>> for AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Ex) -> AngularMomentum

Performs the * operation. Read more
Source§

impl Mul<&Expr<Numeric>> for &AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &Ex) -> AngularMomentum

Performs the * operation. Read more
Source§

impl Mul<AngularMomentum> for i64

Source§

type Output = AngularMomentum

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: AngularMomentum) -> AngularMomentum

Performs the * operation. Read more
Source§

impl Mul<AngularMomentum> for &Ex

Source§

type Output = AngularMomentum

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: AngularMomentum) -> AngularMomentum

Performs the * operation. Read more
Source§

impl Mul<i64> for AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i64) -> AngularMomentum

Performs the * operation. Read more
Source§

impl Mul<i64> for &AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i64) -> AngularMomentum

Performs the * operation. Read more
Source§

impl Neg for AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the - operator.
Source§

fn neg(self) -> AngularMomentum

Performs the unary - operation. Read more
Source§

impl Neg for &AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the - operator.
Source§

fn neg(self) -> AngularMomentum

Performs the unary - operation. Read more
Source§

impl Sub for AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: AngularMomentum) -> AngularMomentum

Performs the - operation. Read more
Source§

impl Sub<&AngularMomentum> for &AngularMomentum

Source§

type Output = AngularMomentum

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &AngularMomentum) -> AngularMomentum

Performs the - operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more