Crate vector_calculus

Source
Expand description

This crate is aimed to be an easy-to-use library for all calculations related to multivariable and vector calculus in Rust, and is able to compute a wide variety of operations numerically, doing so relatively fast.
To achieve this, it contains a growing number of macros designed to create different objects, functions and perform operations. For learning about all of these, you can go to the docs.rs page for this crate. \

§Learn

The recommended order to learn the library is

  1. Vector - Vectors
  2. Function - Scalar functions
  3. VectorFunction - Vector functions
  4. ParametricCurve, Set, Contour - Contours
  5. ParametricSurface, FSet, Surface - Surfaces
  6. integral!, line_integral!, surface_integral! - Integrate everything!!

As extras, also take into account grad!, curl!, div!, derivatives like ddx! and ddyv!, and lastly but not least important: the setup! macro.

§Notes

It is important to note that this project uses the nightly toolchain, so you’ll have to add a rust-toolchain.toml file that indicates to use the nightly build.
Also, due to the experimental nature of Fn implementations, you sometimes might get an error in your IDE when trying to use structs or enums like Function and ParametricCurve as functions, but this code does compile without errors.

§About the crate

This crate was made by a 4th semester physics student to help verify the analytic results obtained in excercises, but is also intended for use in other purposes as well. If you have any issues or ideas, be sure to leave them in this crate’s GitHub page: [https://github.com/OkiMusix05/rust_vector_calculus].

Macros§

contour
Creates a contour
cos
cos function
curl
Curl of a vector function at a point
curve
Creates parametric curves
ddt
Derivative for parametric curves
ddx
Total derivative for single-variable functions and partial x derivative for two and three-variable ones.
ddxv
Partial x for a vector function
ddy
Partial y derivative for two and three-variable functions.
ddyv
Partial y for a vector function
ddz
Partial z derivative for three-variable functions.
ddzv
Partial z for a vector function
div
Divergence of a vector function at a point
f
Creates a one, two, or three-variable function
fset
Creates a function set
grad
Gradient for functions
integral
Integrates scalar functions of one, two, or three variables
limit
Calculus limits for functions
line_integral
Line integrals for scalar and vector functions
ln
ln function
md
Takes the length of a vector
near
Checks if two numbers or vectors are close enough
parametric_surface
Creates a parametric surface
set
Creates a set
setup
Initializes the Integration enums as well as pi and e
sin
sin function
surface
Creates a surface
surface_integral
Integrates a function (scalar or vector) over a surface
tan
tan function
vector
Creates a vector
vector_function
Creates vector functions

Structs§

FSet
Function sets for variable domains
ParametricSurface
Special function of R^2→R^3
Set
Single variable domains
Surface
Surfaces in R^3

Enums§

Contour
Contours for integration
Function
Functions of one, two and three variables
IntegrationMethod
Alternate methods for single integration
MultipleIntegrationMethod
Alternate methods for double/triple integration
ParametricCurve
Parametric curves in R^2 and R^3
Vector
A mathematical vector in R2 or R3.
VectorFunction
Vector functions for 2D and 3D spaces

Constants§

Δ
General Error

Functions§

type_of
Returns the type of any variable