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

Note: I could only test this on windows so i dont't know if it'll work on any other os, but I had perplexity give me the ffmpeg installs for the others and i hope it works there too

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.7

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.7
File Size Uploaded
manim_derivative_plotter-1.0.7.tar.gz 10.6 kB Details

Built distribution (wheel)

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

Total release size: 23.2 kB

Release files / manim_derivative_plotter-1.0.7.tar.gz

Download URL manim_derivative_plotter-1.0.7.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d44e23934d7fd4911c1439b8bf4d44bebd48a2b6d4e793271c8e83f9e7a5c64a
BLAKE2b-256 checksum
How to use checksums
f0c4805ea44710523272686131f2ae2f3a8c33a4498bb5c3e17805beebd3213a
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.7-py3-none-any.whl

Download URL manim_derivative_plotter-1.0.7-py3-none-any.whl
Size 12.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c43413ef2eb2a132a6e1a3c8cce4d3c80b258a73c4ea01d4ac1c4027fd520576
BLAKE2b-256 checksum
How to use checksums
7dfe51dbe9f3330d66eba3b92cac4e7f69d56f9150ed2dfac8a7ccb475989ef5
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

This release

1.0.7 This release

2 release files

1.0.6

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