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

  • You can simply run pip install manim-derivatives-plotter
  • Then you can run python -c "from manim_derivatives import render_picture; render_picture()" for an image
  • and python -c "from manim_derivatives 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.0

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.0
File Size Uploaded
manim_derivative_plotter-1.0.0.tar.gz 8.4 kB Details

Built distribution (wheel)

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

Total release size: 20.8 kB

Release files / manim_derivative_plotter-1.0.0.tar.gz

Download URL manim_derivative_plotter-1.0.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e8d40e08c96c81cd0cc11d1221b932205615434f35385370dcbf981ae542767d
BLAKE2b-256 checksum
How to use checksums
7fa4cc7f874875be53de3120c895232f9851134368a41748b3802686423c23db
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.0-py3-none-any.whl

Download URL manim_derivative_plotter-1.0.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
81d3424ad589dfd6147c673741b01015bf75a02636d293442e0b8254fbbfd3ab
BLAKE2b-256 checksum
How to use checksums
afa71c22b71435bbf4d7183253d3954c0bbd4dc5cd92e72acaa4d363975d8c0d
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

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

This release

1.0.0 This release

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