This file contains hidden or 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 * | |
# inspired by Grant Sanderson's Fourier video | |
# translated to ManimCE and using numpy's FFT | |
class FFTCirclesDotScene(MovingCameraScene): | |
center_point = ORIGIN | |
slow_factor = 0.1 | |
def get_fft_coefficients_of_path(self, path, n_samples=32768, n_freqs = 200): |
This file contains hidden or 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 possible2(Scene): | |
def construct(self): | |
phase = ValueTracker(0) | |
def bottom(): | |
return VMobject().add_points_as_corners( | |
[ | |
*[[x,0.5*np.sin(x-phase.get_value()),0] for x in np.linspace(-8,8,1000)], | |
[8,-8,0],[-8,-8,0],[-8,0,0] | |
] |
This file contains hidden or 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/1178561529914871818/1180619063161016390 | |
class feynman(Scene): | |
def construct(self): | |
MyTexTemplate = TexTemplate() | |
MyTexTemplate.add_to_preamble(r"\usepackage{tikz}\usepackage[compat=1.1.0]{tikz-feynman}") | |
feyn = Tex(r""" | |
\begin{tikzpicture} |
This file contains hidden or 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 testarabic(Scene): | |
def construct(self): | |
i=0 | |
texts = VGroup() | |
for font in Text.font_list(): | |
print(font) | |
texts += VGroup( | |
Text(font, font_size=18).next_to([0,3.5-0.8*i,0],LEFT,buff=0.5), | |
Text("جيب", font=font).next_to([0,3.5-0.8*i,0],RIGHT,buff=0) |
This file contains hidden or 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 * | |
import sys | |
class clitest(Scene): | |
def construct(self): | |
args = VGroup( | |
Text(arg) | |
for arg in self.argv | |
).arrange(DOWN) | |
self.add(args) |
This file contains hidden or 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
# after DIscord user Maxime | |
# https://discord.com/channels/581738731934056449/976376734935048223/1383208229760143532 | |
class GlowDot(VMobject): | |
def __init__(self, point=ORIGIN, r_min=0.05, r_max=0.15, color=YELLOW, n=20, opacity_mult=1.0, **kwargs): | |
super().__init__(fill_color=color, fill_opacity=1, stroke_width=0, **kwargs) | |
for a in np.linspace(0, 1, n): | |
self.add( | |
Dot(point, radius=interpolate(r_min, r_max, a)) | |
) | |
self.set_fill(color, opacity=opacity_mult / n) |
This file contains hidden or 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/1379443317175091252/1379443317175091252 | |
class Test(Scene): | |
def construct(self): | |
numbers = [100]*10 | |
numbersVG = VGroup(Text(str(n)) for n in numbers) | |
numbersVG.arrange(RIGHT).shift(1.3 * DOWN) | |
self.add(numbersVG) |
This file contains hidden or 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/1375396076231594045/1375396076231594045 | |
class FancyBulletlist(VGroup): | |
def __init__(self, bulletobject=None, items=[], **kwargs): | |
super().__init__(**kwargs) | |
if bulletobject == None: | |
bulletobject = Dot() | |
self.items = items |
This file contains hidden or 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 * | |
import manim.mobject.geometry.tips as tips | |
# https://discord.com/channels/581738731934056449/1370706466541011055/1370728872416514141 | |
class reasonablyTipped(Scene): | |
def construct(self): | |
def add_tip( | |
line, | |
shorten=True, |
This file contains hidden or 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_gearbox import * | |
class PlanetaryGears(Scene): | |
def construct(self): | |
# https://en.wikipedia.org/wiki/Epicyclic_gearing#Gear_speed_ratios_of_conventional_epicyclic_gearing | |
omegaplanet = 0.44 | |
omegacarrier = 0.44*10/15 | |
omegaring = (15+35)/35*omegacarrier | |
module = 0.15 # diameter = module * number of teeth |
NewerOlder