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.Image import Resampling | |
| class doesthiswork2(Scene): | |
| def construct(self): | |
| vpixels = 40 | |
| svg = VGroup( | |
| Circle(), | |
| Text("Test") | |
| ) | |
| oheight = svg.height | |
| svg.scale_to_fit_height(8/(config.pixel_height/vpixels),scale_stroke=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 import * | |
| import manifold3d as mf3 | |
| class spherical(ThreeDScene): | |
| def construct(self): | |
| self.set_camera_orientation(phi=70 * DEGREES, theta=-70 * DEGREES) | |
| sp = mf3.Manifold.sphere(radius =2, circular_segments=24) | |
| verts = sp.to_mesh().vert_properties | |
| manimsphere = VGroup( |
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 AnalogMeter(VGroup): | |
| def __init__(self, | |
| value = 0, | |
| width=4, | |
| height=3.5, | |
| corner_radius=0.5, | |
| outer_stroke_width=5, | |
| outer_stroke_color=GRAY, |
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 TransformByGlyphMap | |
| class benzeneAnim(Scene): | |
| def construct(self): | |
| mol1 = Tex( | |
| r"\chemfig{*6(-=-=-=)}", | |
| tex_template=myChemTemplate | |
| ).set_stroke(width=3) | |
| mol2 = Tex( | |
| r"\chemfig{*6(--=-(=O)-=)}", | |
| tex_template=myChemTemplate |
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 * | |
| from mol2chemfigPy3 import mol2chemfig | |
| myChemTemplate = TexTemplate( | |
| tex_compiler="latex", | |
| output_format='.dvi', | |
| preamble=r""" | |
| \usepackage{amsmath} | |
| \usepackage{amssymb} | |
| \usepackage{chemfig} |
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 longdiv(Scene): | |
| def construct(self): | |
| # https://www.calculatorsoup.com/calculators/math/longdivision.php | |
| divisor = 123 | |
| dividend = 764556 | |
| divisor_mobj = VGroup( | |
| *Tex(f"{divisor}")[0] | |
| ) | |
| remainder = 0 | |
| divisor_mobj.arrange_in_grid( |
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 smileyeqn(Scene): | |
| def construct(self): | |
| smiley = ImageMobject("bilder/slightly-smiling-face_1f642.png") | |
| tex_templ = TexTemplate() | |
| tex_templ.add_to_preamble(r"\DeclareMathOperator{\sinc}{sinc}") | |
| eqn = MathTex(r"\sinc(x) = \frac{\sin(x)}{x}", tex_template=tex_templ).to_edge(UP) | |
| self.add(eqn) | |
| eqn2 = eqn.copy().next_to(eqn,DOWN) | |
| smiley.scale_to_fit_width(eqn2[0][5].width*1.5) | |
| smileys = Group( |
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://math.stackexchange.com/questions/2493537/smooth-transition-between-linear-functions | |
| class oscdot4(Scene): | |
| def construct(self): | |
| def f1(x): | |
| return 0 + 0.5*x*2*PI | |
| def f2(x): | |
| return f1(3) + 2.5*(x-3)*2*PI | |
| x0 = 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
| $fn=60; | |
| difference() | |
| { | |
| sphere(r=1.5); | |
| cylinder(h=4,r=1,center=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 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)) |
NewerOlder