Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 1.32 KB

File metadata and controls

54 lines (38 loc) · 1.32 KB

c-graph-plotter

A lightweight C program that draws mathematical function graphs directly in the console, no graphics libraries required.

Console Function Grapher

A simple yet powerful C program that plots mathematical function graphs directly in the console window — using only characters, no graphics or external libraries!


Features

  • Draws any mathematical function (e.g. sin(x), x^2, e^x, etc.)
  • Adjustable scale and step size
  • Works entirely in the console (ASCII-based graph)
  • Written in pure C — no external dependencies
  • Lightweight and easy to compile

How It Works

The program:

  1. Takes a mathematical expression as input (like sin(x) or x*x).
  2. Evaluates the function for a range of x-values.
  3. Maps the computed points to console coordinates.
  4. Draws the graph using ASCII characters.

Example Output

y > x2

else if(y > pow(x, 2)) printf("# ");

y >= sin(x)

else if(y >= sin(x)) printf("# ");

y >= sin(x), x2 + y2 <= 32

Drawing multiple functions

else if(y >= sin(x)) printf("# ");
else if(pow(y, 2) + pow(x, 2) <= 32) printf("- ");