Expand description
§SRMC (Small Rust Math Crate)
srmc
is a collection of mathematical methods, functions, and other useful tools. The goal is to make a stand alone math focused crate that can be used for a wide variety of applications.
Will be continuously updated and improved as I imporve with the Rust langauge.
Structs§
- Matrix
- SRMC Matrix struct with various implementations
Functions§
- create_
identity_ matrix - Returns an SRMC Matrix with diagonal values set to one.
- create_
matrix - Returns an SRMC Matrix swith provided dimensions. All elements of matrix are initially set to zero.
- create_
numbered_ matrix - Returns an SRMC Matrix with provided dimensions. Elements of the matrix start at 1.0 and are incremented by 1.
- create_
sequential_ vec - Creates a vector in numerical order from start to end with steps + 1 elements. NOTE: Elements of vector should be evenly spaced, but often times last two are not. Working on a fix for it, but if evenly spaced values is vital you may need to remove the final value or choose a different step size.
- matrix_
2x2det - Returns the determinant of a 2x2 Matrix.
- matrix_
3x3det - Returns the determinant of a 3x3 Matrix.
- matrix_
addition - Adds two Matricies together and returns the result as an SRMC Matrix
- matrix_
multiplication - Multiplies two Matricies together and returns the result as an SRMC Matrix.
- matrix_
subtraction - Subtracts two Matricies and returns the result as an SRMC Matrix.
- matrix_
transpose - Returns the tranpose of an SRMC Matrix
- percentage_
error - Function to calculate the percentage error between two values
- relative_
error - Function to calculate the relative error between two values
- simpsons
- Uses Simpson’s Method to evaluate a definite integral. Function to be integrated must take on parameter of type f32, and return a value of type f32. See the example functions (sin_x and x_cubed) for examples on how to format input.
- sin_x
- Example input function for sin(x)
- trapzoidal_
rule - Uses The Trapezoidal Rule to evaluate a definite integral. Function to be integrated must take on parameter of type f32, and return a value of type f32. See the example functions (sin_x and x_cubed) for examples on how to format input.
- x_cubed
- Example input function for x cubed