Skip to content

A small program to render math functions as charts with SDL2.

License

Notifications You must be signed in to change notification settings

ZeroBone/SdlGrapher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A small program to render math functions as charts with SDL2.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published