Skip to content
A small program to render math functions as charts with SDL2.
C++ CMake
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmake Now it is fully grapher Feb 24, 2019
screenshots Fixed vertical axis label bug, more screenshots. Mar 2, 2019
src New keypress handler, rerendering only when needed. Mar 15, 2019
.gitattributes
.gitignore Removed build directory from git. Feb 24, 2019
CMakeLists.txt Now it is fully grapher Feb 24, 2019
LICENSE
README.md Fixed vertical axis label bug, more screenshots. Mar 2, 2019
main.cpp Fixed vertical axis label bug, more screenshots. Mar 2, 2019

README.md

SdlGrapher

SdlGrapher is a small program to render math functions as Charts built with SDL2 library. The goal is also to demonstrate floating-point precision errors, that's why i didn't do any border / scaling checks.

Features

  • Horizontal / vertical scrolling.
  • Scaling with mouse wheel.
  • No rendering if the math function returns NaN or Infinity.
  • Movable axises. Screen => Math, Math => Screen unit converters.
  • Automatically calculate scale and axis position based on interval of the math function.
  • Pixel perfect rendering.

Screenshots

f(x) = x ^ 2

Parabola demo

f(x) = 1 / x

Log demo

f(x) = log(x)

Log demo

f(x) = sqrt(x)

Log demo

f(x) = sin(x)

Sin demo

f(x) = sqrt(x) * sin(x)

Sin demo

f(x) = 3 * sin(x / 4) - 2 / sin(2 * x)

Sin2 demo

You can’t perform that action at this time.