https://github.com/bdr-pro/3blue1brownmathsin
testing 3blue1brown pip lib
https://github.com/bdr-pro/3blue1brownmathsin
mathematical-modelling mathematics
Last synced: about 1 year ago
JSON representation
testing 3blue1brown pip lib
- Host: GitHub
- URL: https://github.com/bdr-pro/3blue1brownmathsin
- Owner: BDR-Pro
- Created: 2025-05-19T19:28:13.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-19T19:31:08.000Z (about 1 year ago)
- Last Synced: 2025-05-19T20:39:42.169Z (about 1 year ago)
- Topics: mathematical-modelling, mathematics
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Eaxmple using 3Blue1Brown Animation
## 📈 Plotting `sin(x)` with Manim (No LaTeX Required)
This project demonstrates how to animate the mathematical function `f(x) = sin(x)` using the [Manim Community Edition](https://docs.manim.community). The animation includes:
- Coordinate axes
- A live-drawn sine wave
- A simple `sin(x)` label rendered without LaTeX
## 🧪 What You’ll See
[Watch Here](https://github.com/BDR-Pro/3blue1BrownMathSin/blob/main/media/videos/plot_sin/480p15/PlotSin.mp4)
The animation smoothly draws the sine function on a graph using Manim's `Axes` and `plot()` methods.
---
## 🛠How to Run
1. Clone this repo or copy the code into a `plot_sin.py` file.
2. Open a terminal and run:
```bash
python -m manim -pql plot_sin.py PlotSin
````
This will generate and preview a video in the `media/videos` folder.
---
## 📦 Dependencies
Make sure you have the following installed:
```bash
pip install manim numpy
```
---
## 💡 Code Overview
```python
axes = Axes(...)
graph = axes.plot(lambda x: np.sin(x))
label = Text("sin(x)").next_to(graph, RIGHT)
self.play(Create(axes), Create(graph), Write(label))
```
---
> [!NOTE]
> 💡 This animation uses `Text()` instead of `Tex()`, so **you don’t need a full LaTeX setup**.
> It works out of the box with **TinyTeX** or even with **no LaTeX installed at all**.
>
> 🔢 If you want to display math using LaTeX (e.g. `\\sin(x)`), you’ll need to install [TinyTeX](https://yihui.org/tinytex/) or TeX Live, and make sure both `pdflatex` and `dvisvgm` are available in your system `PATH`.
---
## 🎬 Output
Your video will be saved to:
```txt
./media/videos/plot_sin/480p15/PlotSin.mp4
```
---
## 🔄 Next Steps
Try modifying the code to:
- Plot other functions (`cos(x)`, `x²`, `e^x`)
- Animate function transformations
- Add axis ticks and gridlines
- Use `Tex()` for math-mode labels if LaTeX is available
---
\
*Happy animating! 🎥✨*