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 MF_Tools import ir | |
| class bigeqn(Scene): | |
| def construct(self): | |
| eqn = MathTex( | |
| r"""1+\sum_{i=1}^{2}\left\lfloor\left( | |
| \frac{1}{\sum\limits_{j=1}^{i}\left\lfloor\left(\cos\left(\frac{(j-1)!\,+1}{j}\pi\right)^2\right)\right\rfloor} | |
| \right)^\frac{1}{1}\right\rfloor""" | |
| ) | |
| # uncomment for index labels | |
| #self.add(eqn, index_labels(eqn[0]).set_color(RED)) |
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
| class orbit(Scene): | |
| def construct(self): | |
| ax = Axes( | |
| x_range=[-200e9,200e9,50e9], | |
| y_range=[-200e9,200e9,50e9], | |
| x_length=8, | |
| y_length=8, | |
| tips=False | |
| ) | |
| G = 6.67e-11 |
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 PIL import Image, ImageFilter | |
| class Scene2(MovingCameraScene): | |
| def construct(self): | |
| def blur_image(mobjs, blur=15, bright=1.2, scale_first=1.2): | |
| scene = Scene() | |
| render = scene.renderer | |
| objs = VGroup(*[m.copy().scale(scale_first, about_point=m.get_center()) for m in mobjs]) | |
| render.camera.set_pixel_array(np.zeros_like(render.camera.pixel_array)) | |
| render.camera.capture_mobjects(objs) |
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 tikztest(Scene): | |
| def construct(self): | |
| MyTexTemplate = TexTemplate( | |
| tex_compiler="xelatex", | |
| output_format=".xdv", | |
| documentclass=r"\documentclass[preview,dvisvgm]{standalone}" | |
| ) | |
| MyTexTemplate.add_to_preamble(r"\usepackage{tikz}") |
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 | |
| class LineFromPoints(Line): | |
| def __init__(self, pointsdirections, radius=0, **kwargs): | |
| super().__init__(**kwargs) | |
| pointsradii = [(pointsdirections[0][0],0)] | |
| for p0,p2 in zip(pointsdirections, pointsdirections[1:]): | |
| if len(p0)==3: | |
| r = p0[2] |
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
| class LineThroughPoints(Line): | |
| def __init__(self, pointsdirections, radius=0, **kwargs): | |
| super().__init__(**kwargs) | |
| self.pointsdirections = pointsdirections | |
| self.radius = radius | |
| self.set_points([pointsdirections[0][0]]) | |
| for p0,p1 in zip(pointsdirections,pointsdirections[1:]): | |
| dx,dy,dz = p1[0]-p0[0] | |
| if len(p0) == 3: | |
| r = p0[2] |
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 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
| # https://discord.com/channels/581738731934056449/1414961601127383170/1415086069568766024 | |
| from manim import * | |
| class dotinbox(Scene): | |
| def construct(self): | |
| outerbox = RegularPolygon(n=6).rotate(5*DEGREES).scale_to_fit_height(7) | |
| innerobjs = VGroup( | |
| RegularPolygon(n=5, fill_opacity=1).scale_to_fit_height(2).shift(UR), | |
| Square(side_length=1).shift(DL) | |
| ) |
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] | |
| ] |
NewerOlder