This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class brace3D(ThreeDScene): | |
def construct(self): | |
axes = ThreeDAxes( | |
x_range=[-5,5,1], | |
y_range=[-5,5,1], | |
z_range=[-5,5,1] | |
) | |
self.set_camera_orientation(phi=75 * DEGREES, theta=-45 * DEGREES) | |
self.add(axes) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://discord.com/channels/581738731934056449/1308355923583963197/1308355923583963197 | |
from manim import * | |
class Timer(VGroup): | |
def __init__(self, starttime=99, countdown=True, run=True): | |
super().__init__() | |
self.currenttime = starttime | |
self.starttime = starttime | |
self.countdown = countdown | |
self.dorun = run | |
self.minten = DecimalNumber(0,num_decimal_places=0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from manim import * | |
class myParagraph(Scene): | |
def construct(self): | |
paragraph = Tex(r'''{12em} | |
No, this is an awesome paragraph with \\ Newlines and Alignments\\ | |
\begin{center} | |
center | |
\end{center} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from manim import * | |
def circle_line_intersection(circle: Circle, line: Line): | |
# source https://mathworld.wolfram.com/Circle-LineIntersection.html | |
cline = line.copy().shift(-circle.get_arc_center()) | |
x0,y0 = circle.get_arc_center()[0:2] | |
x1,y1 = cline.get_start()[0:2] | |
x2,y2 = cline.get_end()[0:2] | |
r = circle.width/2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from manim import * | |
# https://discord.com/channels/581738731934056449/1298699478194196612/1298699478194196612 | |
class heptadecagon(MovingCameraScene): | |
def construct(self): | |
# after https://www.youtube.com/watch?v=xGUWVPOks00 AleeDrawing | |
self.add(NumberPlane().add_coordinates()) | |
def circle_line_intersection(circle, line): | |
# source https://mathworld.wolfram.com/Circle-LineIntersection.html | |
cline = line.copy().shift(-circle.get_arc_center()) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from manim import * | |
class sinxsiny(Scene): | |
def construct(self): | |
O = Dot([-3,-3.0,0], color=YELLOW, radius=0.05) | |
A = Dot([3,-3.0,0], color=YELLOW, radius=0.05) | |
lbl_O = MathTex(r"O").next_to(O,LEFT) | |
lbl_A = MathTex(r"A").next_to(A,RIGHT) | |
x = 35*DEGREES | |
y = 20*DEGREES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
In a zoomed scene the outline stroke of the zoomed rectangular frame protrudes into the zoomed view at high magnification | |
''' | |
class ZoomPractice(ZoomedScene): | |
def construct(self): | |
ax = NumberPlane( | |
x_range=[0, 10, 5], | |
y_range=[0, 150, 50], | |
x_length=12, | |
y_length=12, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class connectTheDots(Scene): | |
def construct(self): | |
xvals = [np.random.uniform(-6.5,6.5) for _ in range(20)] | |
yvals = [np.random.uniform(-3.5,3.5) for _ in range(20)] | |
colors = [np.random.choice([RED,GREEN,BLUE,YELLOW,MAROON,ORANGE,WHITE]) for _ in range(20)] | |
dots = VGroup( | |
*[Dot(point=[x,y,0], color=c) for x,y,c in zip(xvals,yvals,colors)] | |
) | |
self.add(dots) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://discord.com/channels/581738731934056449/1290678443905650819/1290678443905650819 | |
from manim import * | |
class autozoom(MovingCameraScene): | |
def construct(self): | |
sq = Square() | |
circ = Circle() | |
self.add(sq,circ) | |
self.add(self.camera.frame) |
NewerOlder