Plot a circle in Manim graph using coordinate equations.
See original GitHub issueHi,
I want to plot the circle x^2 + y^2 = 25
in Manim. I am currently using the following code to get the corresponding values of y
for a given x
:
circle = axes.get_graph(
lambda x: math.sqrt(25 - x**2),
x_range=[-5,5, 0.01]
)
However, there will be two values of y
for each value of x
. This means that I the function only plots a semi-circle. How can I get it to plot the full circle?
Thanks.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7
Top Results From Across the Web
CoordinateSystem - Manim Community v0.17.1
Returns the coordinates of the point on a graph corresponding to an x value. p2c. Abbreviation for point_to_coords(). plot.
Read more >Example Scenes - manim documentation
Many example scenes are given in example_scenes.py , let's start with the simplest and ... self.play(circle.animate.stretch(4, 0)) self.play(Rotate(circle, ...
Read more >how can i draw a curve in polar coordinates? r = 2 + 3.cos ...
Depends on what you ask. There are a few things I'm still trying to figure out in Manim so as a community member...
Read more >3D Graphing | Tutorial 4, Manim Explained - YouTube
Beginning of the Manim Explained series to help people understand how to use Manim (the 3Blue1Brown animation program).
Read more >The Manim Cast #4 - (3D) Graphing, Camera ... - YouTube
SUbscribe to @vcubingx ! https://www.youtube.com/watch?v=g_5P9AW_segManim Cast Playlist: ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Quick update on this thing. I just realized that the circle initialized stays at the center meaning if the Axes method was called on a spot that wasn’t the origin the circle would be left there undisturbed which is not helpful. Like so:
Try this on the original version and the circle doesn’t go to the correct origin.
Solution:
The play method executed in the code above will leave the circle hanging even though it’s been correctly placed this time. For that, remember that Axes is a VGroup so a simple
axes.add(circle)
will do the trick quite nicely.Just thought that might help. Happy animating
Oh that’s easy.
After banging my head against a wall (figuratively of course) my brain reset and I gave up completely on any outside help.
Since then I’ve been studying the original master’s code and actually learning Python and I can say I’m making good progress.
I still would and do watch videos from Theorem of Beethoven cause you grab knowledge where you see it but at this point I’m a big boy with a big man motto