Skip to content

About

Function plotter made in Rust.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust Function Plotter

CLI program written in Rust that parses a mathematical function of x and renders its graph to an image file.

What it does

  • reads function from CLI argument
  • samples function over a numeric range
  • renders 2D plot to image (e.g. PNG)
  • no GUI, no server, just a binary

Requirements

  • Rust (stable)
  • cargo

Build

git clone https://github.com/TygrysGracz/rust-function-plotter
cd rust-function-plotter
cargo build --release

Run cargo run --release -- "sin(x)" output.png

Function syntax, sampling, and output

Function syntax

  • variable: x
  • operators: + - * / ^
  • parentheses supported
  • typical math functions: sin, cos, tan, log, exp (depends on parser implementation)

Sampling and range

  • default X range is hardcoded (check main.rs)
  • step size controls smoothness and performance
  • edit constants in code to change resolution or bounds

Output

  • image is written to the path given as the second argument
  • existing file will be overwritten

About

Function plotter made in Rust.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages