eqdraw

Crates.ioeqdraw
lib.rseqdraw
version0.1.3
created_at2025-08-10 16:22:09.527878+00
updated_at2025-08-14 07:24:59.255055+00
descriptionPlot EQUATIONS directly in your TERMINAL
homepagehttps://github.com/KitoMCVN/eqdraw
repositoryhttps://github.com/KitoMCVN/eqdraw
max_upload_size
id1789064
size71,610
Kito 🍂 (KitoMCVN)

documentation

https://docs.rs/eqdraw

README

eqdraw is a simple yet powerful command-line tool that lets you visualize mathematical functions directly in your terminal using Unicode characters.

eqdraw screenshot

⚙️ Install

You'll need Rust and Cargo installed on your system. Then, run the following command:

cargo install eqdraw

🚀 Quick Usage

Using eqdraw is straightforward. Here are a few examples:

1. Plot a single equation:

eqdraw -q "y=x^2"

2. Plot multiple equations on the same graph:

eqdraw -q "y=sin(x)" -q "y=cos(x)"

3. Customize the view range:

Focus on a specific part of the graph by defining the min/max values for the axes.

eqdraw -q "y=tan(x)" --xmin -3.14 --xmax 3.14 --ymin -2 --ymax 2

📝 Equation Syntax

Equations must follow the format y=<expression_in_x>.

Operators

Operator Description
+ Addition
- Subtraction
* Multiplication
/ Division
^ Power

Constants

Name Value
pi The mathematical constant Pi (π ≈ 3.14159)
e Euler's number (e ≈ 2.71828)

Functions

Function Description
sqrt(x) The square root of x
exp(x) e raised to the power of x
pow(b, e) b raised to the power of e
root(x, n) The nth root of x
abs(x) The absolute value of x
sin(x) The sine of x (x in radians)
cos(x) The cosine of x (x in radians)
tan(x) The tangent of x (x in radians)
cot(x) The cotangent of x (x in radians)
asin(x) The arcsine of x
acos(x) The arccosine of x
atan(x) The arctangent of x
sinh(x) The hyperbolic sine of x
cosh(x) The hyperbolic cosine of x
tanh(x) The hyperbolic tangent of x
ln(x) The natural logarithm of x (base e)
log(x) The base-10 logarithm of x
logb(x, b) The logarithm of x with base b
floor(x) Rounds x down to the nearest integer
ceil(x) Rounds x up to the nearest integer
round(x) Rounds x to the nearest integer

🔧 Command-line Options

Option Alias Description
----queries <equation> -q The equation to plot. Can be used multiple times.
--xmin <XMIN> Minimum value for the x-axis.
--xmax <XMAX> Maximum value for the x-axis.
--ymin <YMIN> Minimum value for the y-axis.
--ymax <YMAX> Maximum value for the y-axis.
--help -h Show the help message.
--version -V Show the version information.

💡 Inspiration

This project was inspired by the fantastic Python library plotille by Tammo Ippen.

🤝 Contributing

Contributions are welcome! If you have an idea for an improvement or a bug fix, please open an Issue or a Pull Request on the repository.

Commit count: 0

cargo fmt