Skip to main content

Compute and draw epicycler in Python

Project description

epicycler

CircleCI codecov Code style: black PyPi Version GitHub stars

circles

Epicylces have been used for millenia to describe the motion of planets; even Copernicus still used them. They got out of fashion when Kepler thought about ellipses, but one can still fool around with epicycles a bit. See mathologer's awesome video about it (which in fact motivated this little package).

Create animations from polygons

Given a number of 2D polygonal points, epicycler creates nice animations. For example, the above is created with

epicycler-poly \
  0.0 0.0 \
  1.0 0.0 \
  1.0 2.0 \
  -0.5 1.1 \
  -0.5 2.1 \
  --xylim -1.5 +2.0 -1.3 3.0

See

epicycler-poly -h

for more options.

Installation

epicycler is available from the Python Package Index, so simply type

pip install -U epicycler

to install or upgrade.

Create animations from image files

seagull

Given a (small) linedrawing image file like the above seagull, epicycler can create an animation from it

epicycler-image in.png -c 0.5

Use the -c option for reducing the number of circles by cutting off those smaller than the given threshold radius; notice then how the polygon points are not followed exactly:

seagull-gif

Creating a GIF

ffmpeg -i out.mp4 -r 10 'frame-%03d.png'
convert -delay 5 -loop 0 frame-*.png out.gif

Testing

To run the epicycler unit tests, check out this repository and type

pytest

Distribution

To create a new release

  1. bump the __version__ number,

  2. publish to PyPi and GitHub:

    make publish
    

License

epicycler is published under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

epicycler-0.1.0.tar.gz (5.7 kB view hashes)

Uploaded Source

Built Distribution

epicycler-0.1.0-py2.py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page