Crates.io | equation_plotter |
lib.rs | equation_plotter |
version | 0.1.6 |
source | src |
created_at | 2024-11-13 11:44:40.752598 |
updated_at | 2024-11-21 02:27:55.200989 |
description | A Rust program to plot mathematical equations and save as PNG files. |
homepage | |
repository | |
max_upload_size | |
id | 1446430 |
size | 130,785 |
A Rust program to plot mathematical equations and save them as PNG files.
Before running the equation_plotter
, ensure you have the following installed:
sudo apt update
sudo apt install pkg-config libfontconfig1-dev
git clone https://github.com/bensatlantik/Rust_Binaries.git
cd Rust_Binaries/equation_plotter
cargo build --release
cargo Run
You can modify the main.rs file to plot different equations by changing the closure passed to the plot_equation function.
Example: To plot the equation y = 3x + 5, update main.rs as follows:
fn main() -> Result<(), Box<dyn std::error::Error>> {
let linear = |x: f64| 3.0 * x + 5.0;
plot_equation(linear, "linear.png")
}
This project is licensed under the MIT License.
bensatlantik