Closed Frigorifico9 closed 3 weeks ago
The problem seems to be nothing but a ordinary division by zero when you divide you vector by abs(pos[0])
for any point along the y-axis (x=0). This can be easily avoided by adding a small value to your denominator. However, I don't understand what exactly you want to show here in the scene...
class potentialEnergy(Scene):
def construct(self):
#func = lambda pos: ((pos[0] * UR + pos[1] * LEFT) - pos) / 3
gravity = lambda pos: (abs(pos[0])*DOWN/(abs(pos[0])+1e-6))
self.add(ArrowVectorField(gravity))
Description of bug / unexpected behavior
I'm trying to make a vector field, but I don't really understand how it works. I wanted to normalize it so I thought I'd divide by the magnitude of the field, but I was clearly wrong and I got an error message telling mt to make a bug report, and so have me here
Expected behavior
I just wanted all the arrows to be the same man
How to reproduce the issue
This is the entirety of my code
Additional media files
This was the previous image I was getting
Images/GIFs
Logs
Terminal output
``` PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR ```System specifications
System Details
- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): - RAM: - Python version (`python/py/python3 --version`): - Installed modules (provide output from `pip list`): ``` PASTE HERE ```LaTeX details
+ LaTeX distribution (e.g. TeX Live 2020): + Installed LaTeX packages:Additional comments