Skip to content
/ plot Public

GLUT-powered plotting engine, capable of drawing real and complex functions and data, as well as some fractals.

License

Notifications You must be signed in to change notification settings

theoden8/plot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plot

Authors

Created by Kirill Rodriguez somewhen between 2014-2015.

Program

Purpose

The whole program is a small mathematical playground visualising sequences, fractals, functions etc.

Description

plot_fractal

Plots a fractal. Use hjkl-=mM to scale the view and the fractal itself.

Below is obtained illustration of mandelbrot set (aka Julia set with F(z, c) = z * z + c):

fractal

Some other fractals and, in particular, Julia sets are also available (try, for example, f(z, c) = sin(z) + c.

illustrator

illustrator_prime_number_theorem

Plots a sequence of points from stdin (above: prime number theorem illustration: (pi(x) / (x / log(x)) - 1, squeezed in width).

complex_in

Plots a sequence of set numbers (from stdin) on complex plane.

graph

graph

Plots a hardcoded function (above: log(n))

graph_i

Plots f(z) on complex plane where z is a complex number with a color depending on z.

As you can see, below is sinh(cos(z)):

graph_i

Notes

Above everything this program is not very accurate because $$f(z) \in{G} \not\rightarrow z \in{G}$$ where G is the grid.

Also, the implementation with GLUT and too many abstract layers can not be normally considered efficient, but it is enough to see something at least.

gen/

The gen/ folder contains various generators, such as of some kinds of fractals, prime numbers etc. Those are to be piped to illustrator or complex_in programs for plotting as they are written to produce input following the necessary format.

Bugs / Errors

For problems on compilation or runtime stage you are always welcome to raise an issue.

Contribution

In case you have a good suggestion, a better implementation or something of your interest to add, you are always welcome to make a pull request.

Installation

Prerequisites

  • cc
  • OpenGL, GLUT
  • cmake

Compiling

cmake . && make

Usage

# plots [i, a[i]] for a
./bin/illustrator # ( < file | <<EOF | <<< command ) stdin

# plots [re(a), im(a)] for a
	./bin/complex_in # ( < file | <<EOF | <<< command ) stdin

# open (graph.cpp|graph_i.cpp|plot_fractal.cpp) and edit the macro
make
./bin/___ # execute

Note

Use at own risk. Speed and convenience are the first priorities.

About

GLUT-powered plotting engine, capable of drawing real and complex functions and data, as well as some fractals.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published