Coder Social home page Coder Social logo

complex-number-plotter's Introduction

complex plotter

This is a program not really meant for widespread use that I've written for upcoming videos on my educational YouTube channel Guru da Ciência.

It renders .mp4 animations and .png plots of complex functions on the real and imaginary plane using Haskell, gnuplot and ffmpeg.

The x and y axis correspond to the real and imaginary components of the input; the z axis shows the magnitude of the output. The phase of the output is shown through color. Alternatively, in the files labeled with phase instead of magnitude, the third dimension stands for the complex argument of the resulting number and the fourth for the magnitude |f(z)|.

The function z^2 + c is used as an example in the included video files, where z is a complex number of the form a + bi. By calling animate $ functionList 1 (-25) 25, the frames z^2 - 25 ... z^2 + 25 are generated and encoded into a .mp4 file.

Individual frames can be generated with plot by passing it a Haskell function, a certain step size and an interval [a,b]:

plot square 0.5 0 10 -- output.png in ./pics

By editing the gnuplot .plt files, borders, tics, title, point type, line width etc. can be specified.

Interactive versions can be found in the folder ./gnuplot-interactive which use the information contained in data.txt created by the plot method.

The pics folder needs to be empty before calling animate or plot.

complex-number-plotter's People

Contributors

danielpetri1 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.