file_path
stringlengths
21
66
content
stringlengths
0
219k
videos_3b1b/_2019/diffyq/all_part4_scenes.py
from _2019.diffyq.part4.staging import * from _2019.diffyq.part4.fourier_series_scenes import * from _2019.diffyq.part4.pi_creature_scenes import * from _2019.diffyq.part4.three_d_graphs import * from _2019.diffyq.part4.temperature_scenes import * from _2019.diffyq.part4.complex_functions import * from _2019.diffyq.par...
videos_3b1b/_2019/diffyq/solve_pendulum_ode_sample_code.py
import numpy as np # Physical constants g = 9.8 L = 2 mu = 0.1 THETA_0 = np.pi / 3 # 60 degrees THETA_DOT_0 = 0 # No initial angular velocity # Definition of ODE def get_theta_double_dot(theta, theta_dot): return -mu * theta_dot - (g / L) * np.sin(theta) # Solution to the differential equation def theta(t): ...
videos_3b1b/_2019/diffyq/all_part1_scenes.py
from _2019.diffyq.part1.pendulum import * from _2019.diffyq.part1.staging import * from _2019.diffyq.part1.pi_scenes import * from _2019.diffyq.part1.phase_space import * from _2019.diffyq.part1.wordy_scenes import * OUTPUT_DIRECTORY = "diffyq/part1" SCENES_IN_ORDER = [ WhenChangeIsEasier, VectorFieldTest, ...
videos_3b1b/_2019/diffyq/all_part5_scenes.py
from _2019.diffyq.part5.staging import * OUTPUT_DIRECTORY = "diffyq/part5" SCENES_IN_ORDER = [ ]
videos_3b1b/_2019/diffyq/fourier_montage_scenes.py
from _2019.diffyq.part4.long_fourier_scenes import * OUTPUT_DIRECTORY = "diffyq/part4" SCENES_IN_ORDER = [ ZoomedInFourierSeriesExample, FourierSeriesExampleWithRectForZoom, ZoomedInFourierSeriesExample100x, FourierOfFourier100xZoom, FourierOfFourierZoomedIn, FourierOfFourier, SigmaZoomedIn...
videos_3b1b/_2019/diffyq/all_part2_scenes.py
from _2019.diffyq.part2.staging import * from _2019.diffyq.part2.fourier_series import * from _2019.diffyq.part2.heat_equation import * from _2019.diffyq.part2.pi_scenes import * from _2019.diffyq.part2.wordy_scenes import * OUTPUT_DIRECTORY = "diffyq/part2" SCENES_IN_ORDER = [ PartTwoOfTour, HeatEquationIntro...
videos_3b1b/_2019/diffyq/all_part3_scenes.py
from _2019.diffyq.part3.staging import * from _2019.diffyq.part3.temperature_graphs import * from _2019.diffyq.part3.pi_creature_scenes import * from _2019.diffyq.part3.wordy_scenes import * from _2019.diffyq.part3.discrete_case import * OUTPUT_DIRECTORY = "diffyq/part3" SCENES_IN_ORDER = [ LastChapterWrapper, ...
videos_3b1b/_2019/diffyq/part4/long_fourier_scenes.py
from manim_imports_ext import * from _2019.diffyq.part4.fourier_series_scenes import ComplexFourierSeriesExample from manimlib.once_useful_constructs.fractals import HilbertCurve class FourierSeriesExampleWithRectForZoom(ComplexFourierSeriesExample): CONFIG = { "n_vectors": 100, "slow_factor": 0....
videos_3b1b/_2019/diffyq/part4/fourier_series_scenes.py
from manim_imports_ext import * from _2019.diffyq.part2.fourier_series import FourierOfTrebleClef from _2019.diffyq.part4.complex_functions import TRangingFrom0To1 from _2019.diffyq.part4.complex_functions import SimpleComplexExponentExample class ComplexFourierSeriesExample(FourierOfTrebleClef): CONFIG = { ...
videos_3b1b/_2019/diffyq/part4/complex_functions.py
from manim_imports_ext import * class GeneralizeToComplexFunctions(Scene): CONFIG = { "axes_config": { "x_min": 0, "x_max": 10, "x_axis_config": { "stroke_width": 2, }, "y_min": -2.5, "y_max": 2.5, "y_axis_...
videos_3b1b/_2019/diffyq/part4/three_d_graphs.py
from manim_imports_ext import * from _2019.diffyq.part3.temperature_graphs import TemperatureGraphScene from _2019.diffyq.part2.wordy_scenes import WriteHeatEquationTemplate class ShowLinearity(WriteHeatEquationTemplate, TemperatureGraphScene): CONFIG = { "temp_text": "Temp", "alpha": 0.1, ...
videos_3b1b/_2019/diffyq/part4/pi_creature_scenes.py
from manim_imports_ext import * class WhyWouldYouCare(TeacherStudentsScene): def construct(self): self.student_says( "Who cares!", target_mode="sassy", index=2, added_anims=[self.teacher.change, "guilty"], ) self.wait() self.play( ...
videos_3b1b/_2019/diffyq/part4/temperature_scenes.py
from manim_imports_ext import * from _2019.diffyq.part2.heat_equation import BringTwoRodsTogether from _2019.diffyq.part3.staging import FourierSeriesIllustraiton class StepFunctionExample(BringTwoRodsTogether, FourierSeriesIllustraiton): CONFIG = { "axes_config": { "y_min": -1.5, ...
videos_3b1b/_2019/diffyq/part4/staging.py
from manim_imports_ext import * from _2019.diffyq.part3.staging import FourierSeriesIllustraiton from _2019.diffyq.part2.wordy_scenes import WriteHeatEquationTemplate class FourierName(Scene): def construct(self): name = OldTexText("Joseph Fourier") name.scale(1.5) self.add(name) class F...
videos_3b1b/_2019/diffyq/part2/shared_constructs.py
from manim_imports_ext import * TIME_COLOR = YELLOW X_COLOR = GREEN def get_heat_equation(): pass def temperature_to_color(temp, min_temp=-1, max_temp=1): colors = [BLUE, TEAL, GREEN, YELLOW, "#ff0000"] alpha = inverse_interpolate(min_temp, max_temp, temp) index, sub_alpha = integer_interpolate( ...
videos_3b1b/_2019/diffyq/part2/wordy_scenes.py
from manim_imports_ext import * class WriteHeatEquationTemplate(Scene): CONFIG = { "tex_mobject_config": { "tex_to_color_map": { "{T}": WHITE, "{t}": YELLOW, "{x}": GREEN, "{y}": RED, "{z}": BLUE, "...
videos_3b1b/_2019/diffyq/part2/pi_scenes.py
from manim_imports_ext import * from _2019.diffyq.part2.wordy_scenes import WriteHeatEquationTemplate class ReactionsToInitialHeatEquation(PiCreatureScene): def construct(self): randy = self.pi_creature randy.set_color(BLUE_C) randy.center() point = VectorizedPoint().next_to(randy...
videos_3b1b/_2019/diffyq/part2/staging.py
from manim_imports_ext import * from _2019.diffyq.part1.staging import TourOfDifferentialEquations class PartTwoOfTour(TourOfDifferentialEquations): CONFIG = { "zoomed_thumbnail_index": 1, } def construct(self): self.add_title() self.show_thumbnails() self.zoom_in_to_one_t...
videos_3b1b/_2019/diffyq/part2/fourier_series.py
from manim_imports_ext import * # import scipy class FourierCirclesScene(Scene): CONFIG = { "n_vectors": 10, "big_radius": 2, "colors": [ BLUE_D, BLUE_C, BLUE_E, GREY_BROWN, ], "circle_style": { "stroke_width": 2, ...
videos_3b1b/_2019/diffyq/part2/heat_equation.py
from manim_imports_ext import * from _2019.diffyq.part2.shared_constructs import * class TwoDBodyWithManyTemperatures(ThreeDScene): CONFIG = { "cells_per_side": 20, "body_height": 6, } def construct(self): self.introduce_body() self.show_temperature_at_all_points() de...
videos_3b1b/_2019/diffyq/part1/pendulum.py
from manim_imports_ext import * from _2019.diffyq.part1.shared_constructs import * class Pendulum(VGroup): CONFIG = { "length": 3, "gravity": 9.8, "weight_diameter": 0.5, "initial_theta": 0.3, "omega": 0, "damping": 0.1, "top_point": 2 * UP, "rod_sty...
videos_3b1b/_2019/diffyq/part1/shared_constructs.py
from manim_imports_ext import * Lg_formula_config = { "tex_to_color_map": { "\\theta_0": WHITE, "{L}": BLUE, "{g}": YELLOW, }, } class You(PiCreature): CONFIG = { "color": BLUE_C, } def get_ode(): tex_config = { "tex_to_color_map": { "{\\thet...
videos_3b1b/_2019/diffyq/part1/phase_space.py
from manim_imports_ext import * from _2019.diffyq.part1.shared_constructs import * from _2019.diffyq.part1.pendulum import Pendulum # TODO: Arguably separate the part showing many # configurations with the part showing just one. class VisualizeStates(Scene): CONFIG = { "coordinate_plane_config": { ...
videos_3b1b/_2019/diffyq/part1/wordy_scenes.py
from manim_imports_ext import * from _2019.diffyq.part1.shared_constructs import * class SmallAngleApproximationTex(Scene): def construct(self): approx = OldTex( "\\sin", "(", "\\theta", ") \\approx \\theta", tex_to_color_map={"\\theta": RED}, arg_separator="", ...
videos_3b1b/_2019/diffyq/part1/pi_scenes.py
from manim_imports_ext import * from _2019.diffyq.part1.shared_constructs import * class SomeOfYouWatching(TeacherStudentsScene): CONFIG = { "camera_config": { "background_color": GREY_E, } } def construct(self): screen = self.screen screen.scale(1.25, about_ed...
videos_3b1b/_2019/diffyq/part1/staging.py
from manim_imports_ext import * from _2019.diffyq.part1.shared_constructs import * from _2019.diffyq.part1.pendulum import Pendulum from _2019.diffyq.part1.pendulum import ThetaVsTAxes from _2019.diffyq.part1.phase_space import IntroduceVectorField from _2018.div_curl import PhaseSpaceOfPopulationModel from _2018.div_c...
videos_3b1b/_2019/diffyq/part5/staging.py
from manim_imports_ext import * T_COLOR = GREY_B VELOCITY_COLOR = GREEN POSITION_COLOR = BLUE CONST_COLOR = YELLOW tex_config = { "tex_to_color_map": { "{t}": T_COLOR, "{0}": T_COLOR, "e^": WHITE, "=": WHITE, } } class IntroductionOfExp(Scene): def construct(self): ...
videos_3b1b/_2019/diffyq/part3/pi_creature_scenes.py
from manim_imports_ext import * from _2019.diffyq.part2.wordy_scenes import * class IveHeardOfThis(TeacherStudentsScene): def construct(self): point = VectorizedPoint() point.move_to(3 * RIGHT + 2 * UP) self.student_says( "I've heard\\\\", "of this!", index=1, ...
videos_3b1b/_2019/diffyq/part3/wordy_scenes.py
from manim_imports_ext import * from _2019.diffyq.part2.wordy_scenes import * class ThreeMainObservations(Scene): def construct(self): fourier = ImageMobject("Joseph Fourier") name = OldTexText("Joseph Fourier") name.match_width(fourier) name.next_to(fourier, DOWN, SMALL_BUFF) ...
videos_3b1b/_2019/diffyq/part3/temperature_graphs.py
from scipy import integrate from manim_imports_ext import * from _2019.diffyq.part2.heat_equation import * class TemperatureGraphScene(SpecialThreeDScene): CONFIG = { "axes_config": { "x_min": 0, "x_max": TAU, "y_min": 0, "y_max": 10, "z_min": -...
videos_3b1b/_2019/diffyq/part3/staging.py
from manim_imports_ext import * from _2019.diffyq.part2.fourier_series import FourierOfTrebleClef class FourierNameIntro(Scene): def construct(self): self.show_two_titles() self.transition_to_image() self.show_paper() def show_two_titles(self): lt = OldTexText("Fourier", "Ser...
videos_3b1b/_2019/diffyq/part3/discrete_case.py
from manim_imports_ext import * from _2019.diffyq.part2.heat_equation import * class ShowNewRuleAtDiscreteBoundary(DiscreteSetup): CONFIG = { "axes_config": { "x_min": 0, "stroke_width": 1, "x_axis_config": { "include_tip": False, }, ...
videos_3b1b/_2019/clacks/name_bump.py
#!/usr/bin/env python from manim_imports_ext import * from _2019.clacks.question import BlocksAndWallExample class NameBump(BlocksAndWallExample): CONFIG = { "name": "Grant Sanderson", "sliding_blocks_config": { "block1_config": { "mass": 1e6, "velocity"...
videos_3b1b/_2019/clacks/solution1.py
from manim_imports_ext import * from _2019.clacks.question import * from _2018.div_curl import ShowTwoPopulations OUTPUT_DIRECTORY = "clacks/solution1" class FromPuzzleToSolution(MovingCameraScene): def construct(self): big_rect = FullScreenFadeRectangle() big_rect.set_fill(GREY_D, 0.5) ...
videos_3b1b/_2019/clacks/all_s2_scenes.py
from _2019.clacks import question from _2019.clacks.solution2 import block_collision_scenes from _2019.clacks.solution2 import mirror_scenes from _2019.clacks.solution2 import pi_creature_scenes from _2019.clacks.solution2 import position_phase_space from _2019.clacks.solution2 import simple_scenes from _2019.clacks.so...
videos_3b1b/_2019/clacks/question.py
from manim_imports_ext import * OUTPUT_DIRECTORY = "clacks/question" class Block(Square): CONFIG = { "mass": 1, "velocity": 0, "width": None, "label_text": None, "label_scale_value": 0.8, "fill_opacity": 1, "stroke_width": 3, "stroke_color": WHITE,...
videos_3b1b/_2019/clacks/solution2/mirror_scenes.py
from manim_imports_ext import * class MirrorScene(Scene): CONFIG = { "center": DOWN + 3 * LEFT, "line_length": FRAME_WIDTH, "start_theta": np.arctan(0.25), "start_y_offset": 0.5, "start_x_offset": 8, "arc_config": { "radius": 1, "stroke_color...
videos_3b1b/_2019/clacks/solution2/position_phase_space.py
from manim_imports_ext import * from _2019.clacks.question import Block from _2019.clacks.question import Wall from _2019.clacks.question import ClackFlashes class PositionPhaseSpaceScene(Scene): CONFIG = { "rescale_coordinates": True, "wall_x": -6, "wall_config": { "height": 1...
videos_3b1b/_2019/clacks/solution2/block_collision_scenes.py
from manim_imports_ext import * class PreviousTwoVideos(BlocksAndWallExample): CONFIG = { "sliding_blocks_config": { "block1_config": { "mass": 1e2, "velocity": -2, "width": 4, "distance": 8, }, "block2_co...
videos_3b1b/_2019/clacks/solution2/pi_creature_scenes.py
from manim_imports_ext import * class OnAnsweringTwice(TeacherStudentsScene): def construct(self): question = OldTexText("Why $\\pi$?") question.move_to(self.screen) question.to_edge(UP) other_questions = VGroup( OldTexText("Frequency of collisions?"), OldTe...
videos_3b1b/_2019/clacks/solution2/wordy_scenes.py
from manim_imports_ext import * from _2019.clacks.solution2.position_phase_space import ShowMomentumConservation class ConnectionToOptics(Scene): def construct(self): e_group, m_group = k_groups = self.get_kinematics_groups() c_group, a_group = o_groups = self.get_optics_groups() arrows = ...
videos_3b1b/_2019/clacks/solution2/simple_scenes.py
from manim_imports_ext import * from _2018.lost_lecture import ShowWord from _2019.clacks.solution2.mirror_scenes import ReflectWorldThroughMirrorNew from _2019.clacks.question import Thumbnail class WrapperScene(Scene): CONFIG = { "title": "Title", "shade_of_grey": "#333333" } def constr...
videos_3b1b/_2019/bayes/part1.py
from manim_imports_ext import * import scipy.integrate OUTPUT_DIRECTORY = "bayes/part1" HYPOTHESIS_COLOR = YELLOW NOT_HYPOTHESIS_COLOR = GREY EVIDENCE_COLOR1 = BLUE_C EVIDENCE_COLOR2 = BLUE_E NOT_EVIDENCE_COLOR1 = GREY NOT_EVIDENCE_COLOR2 = GREY_D # def get_bayes_formula(expand_denominator=False): t2c = { ...
videos_3b1b/_2019/bayes/footnote.py
from manim_imports_ext import * from _2019.bayes.part1 import BayesDiagram from _2019.bayes.part1 import LibrarianIcon from _2019.bayes.part1 import Person from _2019.bayes.part1 import RandomnessVsProportions OUTPUT_DIRECTORY = "bayes/footnote" TEX_TO_COLOR_MAP = { "A": YELLOW, "B": BLUE, } MID_COLOR = interp...
videos_3b1b/_2021/some1.py
from manim_imports_ext import * def get_tripple_underline(mobject, buff=0.1): ul1 = Underline(mobject, buff=buff).set_stroke(BLUE_C, 3) ul2 = Underline(ul1).scale(0.9).set_stroke(BLUE_D, 2) ul3 = Underline(ul2).scale(0.9).set_stroke(BLUE_E, 1) return VGroup(ul1, ul2, ul3) def get_h_line(): line ...
videos_3b1b/_2021/quick_eigen.py
from manim_imports_ext import * # Colors COL_COLORS = [MAROON_B, MAROON_C] EIGEN_COLORS = [TEAL_A, TEAL_D] MEAN_COLOR = BLUE_B PROD_COLOR = BLUE_D def det_path_anim(matrix, run_time=2): path = VMobject() path.set_points_smoothly([ matrix.get_corner(UL), *[ matrix.get_entries()[i]...
videos_3b1b/_2021/bertrands_paradox.py
from manim_imports_ext import * class RandomChordScene(Scene): title = "" radius = 3.5 n_samples = 1000 long_color = BLUE short_color = WHITE chord_width = 0.5 chord_opacity = 0.35 run_time = 20 include_triangle = True def construct(self): circle = self.circle = Circle...
videos_3b1b/_2021/shadows.py
from manim_imports_ext import * import scipy.spatial # Helpers def project_to_xy_plane(p1, p2): """ Draw a line from source to p1 to p2. Where does it intersect the xy plane? """ x1, y1, z1 = p1 x2, y2, z2 = p2 if z2 < z1: z2 = z1 + 1e-2 # TODO, bad hack vect = p2 - p1 re...
videos_3b1b/_2021/matrix_exp.py
from manim_imports_ext import * def get_matrix_exponential(matrix, height=1.5, scalar_tex="t", **matrix_config): elem = matrix[0][0] if isinstance(elem, str): mat_class = Matrix elif isinstance(elem, int) or isinstance(elem, np.int64): mat_class = IntegerMatrix else: mat_class ...
videos_3b1b/_2021/some1_winners.py
from manim_imports_ext import * from manimlib.logger import log import urllib.request WINNERS = [ ("That weird light at the bottom of a mug — ENVELOPES", "Paralogical", "fJWnA4j0_ho"), ("Hiding Images in Plain Sight: The Physics Of Magic Windows", "Matt Ferraro", "CatInCausticImage"), ("The Beauty of Bézi...
videos_3b1b/_2021/holomorphic_dynamics.py
from manim_imports_ext import * from _2022.newton_fractal import * MANDELBROT_COLORS = [ "#00065c", "#061e7e", "#0c37a0", "#205abc", "#4287d3", "#D9EDE4", "#F0F9E4", "#BA9F6A", "#573706", ] def get_c_dot_label(dot, get_c, font_size=24, direction=UP): c_label = VGroup( ...
videos_3b1b/_2021/newton_fractal.py
from manim_imports_ext import * from _2022.quintic import coefficients_to_roots from _2022.quintic import roots_to_coefficients from _2022.quintic import dpoly from _2022.quintic import poly ROOT_COLORS_BRIGHT = [RED, GREEN, BLUE, YELLOW, MAROON_B] ROOT_COLORS_DEEP = ["#440154", "#3b528b", "#21908c", "#5dc963", "#29...
videos_3b1b/_2021/siggraph.py
from manim_imports_ext import * class ThreePis(Scene): def construct(self): pis = VGroup(*(PiCreature() for x in range(3))) for pi, color in zip(pis, (BLUE_E, BLUE_C, BLUE_D)): pi.set_color(color) pis.set_height(2) pis.arrange(RIGHT, buff=2) pis.to_corner(DR) ...