Skip to main content

This is a Python Derivative plotter made with manim

What does it do?

There are two main codes here.

  • useful_derivatives.py
  • derivatives_simple.py

With both you can basically do the same

  1. Give it a simple polynomial function as a String like "2x4+3x2"
  2. It calculates the first and second derivatives of the function
  3. It plots all of them
  4. It shows you all their zero points
  5. It shows you the Extremes and Turning points of the function

The only difference between the two is, that the simple version only shows all that to you while the other one animates it look at the program outputs here

What do the results mean:

in the picture version

  • blue line: main function
  • blue dots: zeros of the main function
  • green line: the first derivative function
  • green dots: extremes of the main function (TIP=local minimum,HOP=local maxiumum,TEP=middle points with zero slope)
  • red line: second derivative function
  • red dots: turning points of the main function
  • purple is where the main function is curved to the left
  • yellow is where the main function is curved to the right

in the animation

  • First it animates the main function and it's zeros in blue
  • then the first derivative function and it's zeros in green
  • then the second derivative function and it's zeros in red
  • Afterwards it shows you the extremes in Blue (TIP=local minimum,HOP=local maxiumum,TEP=middle points with zero slope)
  • And then the turns in Blue and the curvature of the function purple=left yellow=right and the turning points

How can you do it yourself

install ffmpeg

  • as this package uses manim you first have to install ffmpeg:

Windows

winget install Gyan.FFmpeg

macOS

brew install ffmpeg

Ubuntu / Debian

sudo apt update
sudo apt install ffmpeg

Fedora

sudo dnf install ffmpeg

Then open a new terminal and confirm:

ffmpeg -version

install and run package

  • You can simply run pip install manim-derivative-plotter

  • Then you can run python -c "from manim_derivative_plotter import render_picture; render_picture()" for an image

  • and python -c "from manim_derivative_plotter import render_animation; render_animation()" for a video.

  • to Input your function you just type it in the command prompt

  • Input style for functions: coefficientxpower+next-coefficienxnext-power...

  • A few examples:

  1. 2x3
  2. x3-4x2
  3. 4.3x4+x
  4. -2.5x6-x2+3

How did I build it

I used manim to animate and sympy for the zero points, so a big thanks to Grant SAnderson from 3blue1brown. I used perplexity and a little GitHub Copilot for research especially for specific manim functions and to write a few little functionalities with syntaxes I didn't know but never more than 2-3 lines and a lot of help on the package structure. I also used it to understand the errors that were output. This is my first manim project and I'm quite happy with how it turned out and I plan to do more.

to Do (for future reference)

  • maybe make interactive
  • make input more user friendly
  • make handle of constants better
  • typst color work
  • test typst install
  • typst in animation

Metadata

Release files for manim-derivative-plotter 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for manim-derivative-plotter 1.0.6
File Size Uploaded
manim_derivative_plotter-1.0.6.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for manim-derivative-plotter 1.0.6
File Interpreter ABI Platform
manim_derivative_plotter-1.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 22.9 kB

Release files / manim_derivative_plotter-1.0.6.tar.gz

Download URL manim_derivative_plotter-1.0.6.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
68bac7e3da7784e32e7e58549c9e9a17b85eba0829fb1e4e8caa824f27834553
BLAKE2b-256 checksum
How to use checksums
47ef38006ce593dd884ca6a0af3a1f01cc2e4fd43660592c05f01a772da026d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release files / manim_derivative_plotter-1.0.6-py3-none-any.whl

Download URL manim_derivative_plotter-1.0.6-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
36d5e3cda09744fe11992fe895953e5900b7b740140bb8ddd536f1ddef7e95ad
BLAKE2b-256 checksum
How to use checksums
57d9e928452d39bfaf48b97f7f9dc5d2344741bd83d88ab9f56049490cc41b84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release history Release notifications | RSS feed

1.0.7

2 release files

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page