mathematical animations with haskell https://reanimate.github.io
  • Haskell 95.8%
  • Elm 3.9%
  • Nix 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
David Himmelstrup b466bcc6be Misc cleanup. (#55)
Former-commit-id: 8490a1405235c3902e8bca9d7fc2f6845b287d19
2020-02-20 16:34:52 +08:00
.azure Geo projections (#52) 2020-02-11 19:10:45 +08:00
data Geo projections (#52) 2020-02-11 19:10:45 +08:00
docs Fix typo 2019-12-10 01:20:09 +00:00
examples Misc cleanup. (#55) 2020-02-20 16:34:52 +08:00
misc Add bending blender test. 2019-12-01 14:58:45 +08:00
src Misc cleanup. (#55) 2020-02-20 16:34:52 +08:00
test Misc cleanup. (#55) 2020-02-20 16:34:52 +08:00
videos Feature colortheory (#57) 2020-02-19 20:26:52 +08:00
viewer-elm Add white border to progress bar 2020-01-05 11:42:37 +08:00
.gitignore Add .stack-work to .gitignore 2019-12-10 10:36:07 +01:00
azure-pipelines.yml Fix azure formatting. 2019-09-17 10:04:23 +08:00
ChangeLog.md Bump version to 0.1.6.0 2019-09-14 17:46:03 +08:00
LICENSE Create LICENSE 2019-09-12 23:00:55 +08:00
mkdocs.yml Documentation. (#12) 2019-09-19 16:52:34 +08:00
README.md Add map projection gif. 2020-02-12 20:50:11 +08:00
reanimate.cabal Geo projections (#52) 2020-02-11 19:10:45 +08:00
RESOURCES.md Geo projections (#52) 2020-02-11 19:10:45 +08:00
Setup.hs First stab at reanimate. 2019-02-13 21:08:49 +01:00
stack-lts-11.yaml Feature showcase (#29) 2019-11-17 13:02:37 +08:00
stack-lts-12.yaml Feature showcase (#29) 2019-11-17 13:02:37 +08:00
stack.yaml Feature showcase (#29) 2019-11-17 13:02:37 +08:00
stack.yaml.lock Feature showcase (#29) 2019-11-17 13:02:37 +08:00

Hackage Build Status Documentation Status Platforms

Reanimate

Reanimate is a library for programmatically generating animations with a twist towards mathematics / 2D vector drawings. A lot of inspiration was drawn from 3b1b's manim library.

Reanimate aims at being a batteries-included way of gluing together different technologies: SVG as a universal image format, LaTeX for typesetting, ffmpeg for video encoding, inkscape/imagemagick for rasterization, potrace for vectorization, blender/povray for 3D graphics, and Haskell for scripting.

In more practical terms, reanimate is a library for turning code like this:

main = reanimate $ docEnv $ playThenReverseA $ mkAnimation duration $ \t ->
  partialSvg t $ pathify $ mkCircle radius
  where duration = 2; radius = screenHeight/3

... into animations like this:

Draw Circle

Prerequisites

Reanimate is built using the Haskell Tool Stack. For installation instructions, see: https://docs.haskellstack.org/en/stable/README/

Optionally, you can install one or more of these programs to enable additional features:

I highly recommend that you install at least 'ffmpeg' and 'latex'.

Installing / Running an example

Reanimate ships with a web-based viewer and automatic code reloading. To get a small demo up and running, clone the repository, run one of the examples (this will install the library), and wait for a browser window to open:

$ git clone https://github.com/Lemmih/reanimate.git
$ cd reanimate/
$ stack build
$ stack ./examples/doc_drawCircle.hs

This should render the doc_drawCircle example in a new browser window. If you then change the animation source code, the browser window will automatically reload and show the updated animation.

Documentation

Examples

The example gifs are displayed at 25 fps.

Map projections LaTeX wheel Sunflower Tangent Goo Drawing LaTeX equations Bounding boxes Colorful LaTeX Bezier curves Valentine's Day Basic LaTeX

Authors

  • David Himmelstrup.
  • Jan Hrcek.

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

Acknowledgments

  • Huge thanks to 3b1b's manim which inspired this library.
  • Thanks to svg-tree for their SVG library.
  • Thanks to CthulhuDen/chiphunk for making a 2D physics library easily available.

YouTube

Completed animations are uploaded to the Reanimated Science channel.

Animation snippets are uploaded to the Reanimated Science Playground channel.