pub struct ParametricDifferentiation;Expand description
Parametric differentiation operations
Implementations§
Source§impl ParametricDifferentiation
impl ParametricDifferentiation
Sourcepub fn first_derivative(
x_param: &Expression,
y_param: &Expression,
parameter: Symbol,
) -> Expression
pub fn first_derivative( x_param: &Expression, y_param: &Expression, parameter: Symbol, ) -> Expression
Compute dy/dx for parametric curve with cached derivatives
Uses formula: dy/dx = (dy/dt) / (dx/dt)
§Examples
use mathhook_core::simplify::Simplify;
use mathhook_core::calculus::derivatives::Derivative;
use mathhook_core::{Expression};
use mathhook_core::symbol;
use mathhook_core::calculus::derivatives::ParametricDifferentiation;
let t = symbol!(t);
let x_param = Expression::function("cos", vec![Expression::symbol(t.clone())]);
let y_param = Expression::function("sin", vec![Expression::symbol(t.clone())]);
let dy_dx = ParametricDifferentiation::first_derivative(&x_param, &y_param, t);Sourcepub fn second_derivative(
x_param: &Expression,
y_param: &Expression,
parameter: Symbol,
) -> Expression
pub fn second_derivative( x_param: &Expression, y_param: &Expression, parameter: Symbol, ) -> Expression
Compute d²y/dx² for parametric curves
Uses formula: d²y/dx² = (d/dt(dy/dx)) / (dx/dt)
§Examples
use mathhook_core::{Expression};
use mathhook_core::symbol;
use mathhook_core::calculus::derivatives::ParametricDifferentiation;
let t = symbol!(t);
let x_param = Expression::symbol(t.clone());
let y_param = Expression::pow(Expression::symbol(t.clone()), Expression::integer(2));
let d2y_dx2 = ParametricDifferentiation::second_derivative(&x_param, &y_param, t);Sourcepub fn arc_length_differential(
x_param: &Expression,
y_param: &Expression,
parameter: Symbol,
) -> Expression
pub fn arc_length_differential( x_param: &Expression, y_param: &Expression, parameter: Symbol, ) -> Expression
Compute arc length differential
Formula: ds = √((dx/dt)² + (dy/dt)²)
§Examples
use mathhook_core::simplify::Simplify;
use mathhook_core::{Expression};
use mathhook_core::symbol;
use mathhook_core::calculus::derivatives::ParametricDifferentiation;
let t = symbol!(t);
let x_param = Expression::symbol(t.clone());
let y_param = Expression::pow(Expression::symbol(t.clone()), Expression::integer(2));
let arc_length_diff = ParametricDifferentiation::arc_length_differential(&x_param, &y_param, t);Sourcepub fn curvature(
x_param: &Expression,
y_param: &Expression,
parameter: Symbol,
) -> Expression
pub fn curvature( x_param: &Expression, y_param: &Expression, parameter: Symbol, ) -> Expression
Compute curvature for parametric curves
Formula: κ = |x’y’’ - y’x’’| / (x’² + y’²)^(3/2)
§Examples
use mathhook_core::calculus::derivatives::Derivative;
use mathhook_core::{Expression};
use mathhook_core::symbol;
use mathhook_core::calculus::derivatives::ParametricDifferentiation;
let t = symbol!(t);
let x_param = Expression::function("cos", vec![Expression::symbol(t.clone())]);
let y_param = Expression::function("sin", vec![Expression::symbol(t.clone())]);
let curvature = ParametricDifferentiation::curvature(&x_param, &y_param, t);Auto Trait Implementations§
impl Freeze for ParametricDifferentiation
impl RefUnwindSafe for ParametricDifferentiation
impl Send for ParametricDifferentiation
impl Sync for ParametricDifferentiation
impl Unpin for ParametricDifferentiation
impl UnwindSafe for ParametricDifferentiation
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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>
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 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>
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