file_path stringlengths 21 66 | content stringlengths 0 219k |
|---|---|
videos_3b1b/README.md | This project contains the code used to generate the explanatory math videos found on [3Blue1Brown](https://www.3blue1brown.com/).
This almost entirely consists of scenes generated using the library [Manim](https://github.com/3b1b/manim). See also the community maintained version at [ManimCommunity](https://github.com... |
videos_3b1b/stage_scenes.py | #!/usr/bin/env python
import inspect
import os
import sys
import importlib
from manimlib.config import get_module
from manimlib.extract_scene import is_child_scene
def get_sorted_scene_classes(module_name):
module = get_module(module_name)
if hasattr(module, "SCENES_IN_ORDER"):
return module.SCENES_I... |
videos_3b1b/manim_imports_ext.py | from manimlib import *
from manimlib.mobject.svg.old_tex_mobject import *
from custom.backdrops import *
from custom.banner import *
from custom.characters.pi_creature import *
from custom.characters.pi_creature_animations import *
from custom.characters.pi_creature_scene import *
from custom.deprecated import *
from ... |
videos_3b1b/custom_config.yml | directories:
mirror_module_path: True
removed_mirror_prefix: "/Users/grant/cs/videos/"
output: "/Users/grant/3Blue1Brown Dropbox/3Blue1Brown/videos"
raster_images: "/Users/grant/3Blue1Brown Dropbox/3Blue1Brown/images/raster"
vector_images: "/Users/grant/3Blue1Brown Dropbox/3Blue1Brown/images/vector"
pi_crea... |
videos_3b1b/_2017/borsuk.py | from manim_imports_ext import *
from functools import reduce
class Jewel(VMobject):
CONFIG = {
"color" : WHITE,
"fill_opacity" : 0.75,
"stroke_width" : 0,
"height" : 0.5,
"num_equator_points" : 5,
"sun_vect" : OUT+LEFT+UP,
}
def init_points(self):
for... |
videos_3b1b/_2017/triples.py | import fractions
from manim_imports_ext import *
A_COLOR = BLUE
B_COLOR = GREEN
C_COLOR = YELLOW
SIDE_COLORS = [A_COLOR, B_COLOR, C_COLOR]
U_COLOR = GREEN
V_COLOR = RED
#revert_to_original_skipping_status
def complex_string_with_i(z):
if z.real == 0:
return str(int(z.imag)) + "i"
elif z.imag == 0:
... |
videos_3b1b/_2017/gradient.py | from manim_imports_ext import *
# Warning, this file uses ContinualChangingDecimal,
# which has since been been deprecated. Use a mobject
# updater instead
class GradientDescentWrapper(Scene):
def construct(self):
title = OldTexText("Gradient descent")
title.to_edge(UP)
rect = ScreenRec... |
videos_3b1b/_2017/highD.py | from manim_imports_ext import *
##########
#force_skipping
#revert_to_original_skipping_status
##########
class Slider(NumberLine):
CONFIG = {
"color" : WHITE,
"x_min" : -1,
"x_max" : 1,
"unit_size" : 2,
"center_value" : 0,
"number_scale_val" : 0.75,
"label... |
videos_3b1b/_2017/qa_round_two.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from manim_imports_ext import *
from _2017.efvgt import get_confetti_animations
class Test(Scene):
def construct(self):
pass
class Announcements(PiCreatureScene):
def construct(self):
title = OldTexText("Announcements!")
title.scale(1.5)
... |
videos_3b1b/_2017/efvgt.py | from manim_imports_ext import *
ADDER_COLOR = GREEN
MULTIPLIER_COLOR = YELLOW
def normalize(vect):
norm = get_norm(vect)
if norm == 0:
return OUT
else:
return vect/norm
def get_composite_rotation_angle_and_axis(angles, axes):
angle1, axis1 = 0, OUT
for angle2, axis2 in zip(angles,... |
videos_3b1b/_2017/tattoo.py | from manim_imports_ext import *
class TrigRepresentationsScene(Scene):
CONFIG = {
"unit_length" : 1.5,
"arc_radius" : 0.5,
"axes_color" : WHITE,
"circle_color" : RED,
"theta_color" : YELLOW,
"theta_height" : 0.3,
"theta_value" : np.pi/5,
"x_line_colo... |
videos_3b1b/_2017/waves.py | from manim_imports_ext import *
import warnings
warnings.warn("""
Warning: This file makes use of
ContinualAnimation, which has since
been deprecated
""")
E_COLOR = BLUE
M_COLOR = YELLOW
# Warning, much of what is below was implemented using
# ConintualAnimation, which has now been deprecated. One
# ... |
videos_3b1b/_2017/cba.py | from manim_imports_ext import *
class EnumerableSaveScene(Scene):
def setup(self):
self.save_count = 0
def save_enumerated_image(self):
file_path = self.file_writer.get_image_file_path()
file_path = file_path.replace(
".png", "{:02}.png".format(self.save_count)
)
... |
videos_3b1b/_2017/putnam.py | from manim_imports_ext import *
class ShowExampleTest(ExternallyAnimatedScene):
pass
class IntroducePutnam(Scene):
CONFIG = {
"dont_animate" : False,
}
def construct(self):
title = OldTexText("Putnam Competition")
title.to_edge(UP, buff = MED_SMALL_BUFF)
title.set_color... |
videos_3b1b/_2017/leibniz.py | from manim_imports_ext import *
from functools import reduce
# revert_to_original_skipping_status
def chi_func(n):
if n%2 == 0:
return 0
if n%4 == 1:
return 1
else:
return -1
class LatticePointScene(Scene):
CONFIG = {
"y_radius" : 6,
"x_radius" : None,
... |
videos_3b1b/_2017/crypto.py | from manim_imports_ext import *
from hashlib import sha256
import binascii
#force_skipping
#revert_to_original_skipping_status
BITCOIN_COLOR = "#f7931a"
def get_cursive_name(name):
result = OldTexText("\\normalfont\\calligra %s"%name)
result.set_stroke(width = 0.5)
return result
def sha256_bit_string(m... |
videos_3b1b/_2017/fractal_dimension.py |
from manim_imports_ext import *
from functools import reduce
def break_up(mobject, factor = 1.3):
mobject.scale(factor)
for submob in mobject:
submob.scale(1./factor)
return mobject
class Britain(SVGMobject):
CONFIG = {
"file_name" : "Britain.svg",
"stroke_width" : 0,
... |
videos_3b1b/_2017/bell.py | from manim_imports_ext import *
from tqdm import tqdm as ProgressDisplay
from .waves import *
from functools import reduce
#force_skipping
#revert_to_original_skipping_status
class PhotonPassesCompletelyOrNotAtAll(DirectionOfPolarizationScene):
CONFIG = {
"pol_filter_configs" : [{
"include_a... |
videos_3b1b/_2017/256.py | from manim_imports_ext import *
from _2017.crypto import sha256_tex_mob, bit_string_to_mobject, BitcoinLogo
def get_google_logo():
result = SVGMobject(
file_name = "google_logo",
height = 0.75
)
blue, red, yellow, green = [
"#4885ed", "#db3236", "#f4c20d", "#3cba54"
]
color... |
videos_3b1b/_2017/mug.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from manim_imports_ext import *
# from _2017.efvgt import ConfettiSpiril
#revert_to_original_skipping_status
class HappyHolidays(TeacherStudentsScene):
def construct(self):
hats = VGroup(*list(map(
self.get_hat, self.pi_creatures
)))
... |
videos_3b1b/_2017/eoc/chapter6.py | from manim_imports_ext import *
SPACE_UNIT_TO_PLANE_UNIT = 0.75
class Chapter6OpeningQuote(OpeningQuote):
CONFIG = {
"quote" : [
"Do not ask whether a ",
"statement is true until",
"you know what it means."
],
"author" : "Errett Bishop"
}
class This... |
videos_3b1b/_2017/eoc/chapter3.py | from manim_imports_ext import *
from _2017.eoc.chapter2 import DISTANCE_COLOR, TIME_COLOR, \
VELOCITY_COLOR, Car, MoveCar
OUTPUT_COLOR = DISTANCE_COLOR
INPUT_COLOR = TIME_COLOR
DERIVATIVE_COLOR = VELOCITY_COLOR
class Chapter3OpeningQuote(OpeningQuote):
CONFIG = {
"quote" : [
"You know, for... |
videos_3b1b/_2017/eoc/chapter9.py | import scipy
import fractions
from manim_imports_ext import *
class Chapter9OpeningQuote(OpeningQuote):
CONFIG = {
"quote" : [
"We often hear that mathematics consists mainly of",
"proving theorems.",
"Is a writer's job mainly that of\\\\",
"writing sentenc... |
videos_3b1b/_2017/eoc/chapter2.py | from manim_imports_ext import *
DISTANCE_COLOR = BLUE
TIME_COLOR = YELLOW
VELOCITY_COLOR = GREEN
#### Warning, scenes here not updated based on most recent GraphScene changes #######
class IncrementNumber(Succession):
CONFIG = {
"start_num" : 0,
"changes_per_second" : 1,
"run_time" : 11... |
videos_3b1b/_2017/eoc/chapter8.py | import scipy
from manim_imports_ext import *
from _2017.eoc.chapter1 import Thumbnail as Chapter1Thumbnail
from _2017.eoc.chapter2 import Car, MoveCar, ShowSpeedometer, \
IncrementNumber, GraphCarTrajectory, SecantLineToTangentLine, \
VELOCITY_COLOR, TIME_COLOR, DISTANCE_COLOR
def v_rate_func(t):
return 4*... |
videos_3b1b/_2017/eoc/chapter10.py | from manim_imports_ext import *
def derivative(func, x, n = 1, dx = 0.01):
samples = [func(x + (k - n/2)*dx) for k in range(n+1)]
while len(samples) > 1:
samples = [
(s_plus_dx - s)/dx
for s, s_plus_dx in zip(samples, samples[1:])
]
return samples[0]
def taylor_appr... |
videos_3b1b/_2017/eoc/chapter7.py | # -*- coding: utf-8 -*-
from manim_imports_ext import *
class Chapter7OpeningQuote(OpeningQuote):
CONFIG = {
"quote" : [
" Calculus required ",
"continuity",
", and ",
"continuity ",
"was supposed to require the ",
"infinitely little",... |
videos_3b1b/_2017/eoc/chapter5.py | from manim_imports_ext import *
from _2017.eoc.chapter4 import ThreeLinesChainRule
class ExpFootnoteOpeningQuote(OpeningQuote):
CONFIG = {
"quote" : [
"Who has not been amazed to learn that the function",
"$y = e^x$,", "like a phoenix rising again from its own",
"ashes, is its own d... |
videos_3b1b/_2017/eoc/footnote.py | import scipy
import math
from manim_imports_ext import *
from _2017.eoc.eoc.chapter1 import Car, MoveCar
from _2017.eoc.eoc.chapter10 import derivative
#revert_to_original_skipping_status
########
class Introduce(TeacherStudentsScene):
def construct(self):
words = OldTexText("Next up is \\\\", "Taylor ... |
videos_3b1b/_2017/eoc/chapter1.py | from manim_imports_ext import *
from _2017.eoc.chapter2 import Car, MoveCar
class Eoc1Thumbnail(GraphScene):
CONFIG = {
}
def construct(self):
title = OldTexText(
"The Essence of\\\\Calculus",
tex_to_color_map={
"\\emph{you}": YELLOW,
},
... |
videos_3b1b/_2017/eoc/chapter4.py | from manim_imports_ext import *
SINE_COLOR = BLUE
X_SQUARED_COLOR = GREEN
SUM_COLOR = YELLOW
PRODUCT_COLOR = YELLOW
class Chapter4OpeningQuote(OpeningQuote):
CONFIG = {
"quote" : [
"Using the chain rule is like peeling an onion: ",
"you have to deal with each layer at a time, and "... |
videos_3b1b/_2017/eoc/old_chapter1.py | from manim_imports_ext import *
#### Warning, scenes here not updated based on most recent GraphScene changes #######
class CircleScene(PiCreatureScene):
CONFIG = {
"radius" : 1.5,
"stroke_color" : WHITE,
"fill_color" : BLUE_E,
"fill_opacity" : 0.5,
"radial_line_color" : M... |
videos_3b1b/_2017/dominos/domino_play.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from manim_imports_ext import *
class SimpleVelocityGraph(GraphScene):
CONFIG = {
# "frame_rate" : 4000,
# "domino_thickness" : 7.5438,
# "domino_spacing" : 8.701314282,
"data_files" : [
"data07.txt",
"data13.t... |
videos_3b1b/_2017/nn/mnist_loader.py | """
mnist_loader
~~~~~~~~~~~~
A library to load the MNIST image data. For details of the data
structures that are returned, see the doc strings for ``load_data``
and ``load_data_wrapper``. In practice, ``load_data_wrapper`` is the
function usually called by our neural network code.
"""
#### Libraries
# Standard lib... |
videos_3b1b/_2017/nn/part1.py | import sys
import os.path
import cv2
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from manim_imports_ext import *
import warnings
warnings.warn("""
Warning: This file makes use of
ContinualAnimation, which has since
been deprecated
""")
from nn.network import *
#force_skipping
#rever... |
videos_3b1b/_2017/nn/network.py | """
network.py
~~~~~~~~~~
A module to implement the stochastic gradient descent learning
algorithm for a feedforward neural network. Gradients are calculated
using backpropagation. Note that I have focused on making the code
simple, easily readable, and easily modifiable. It is not optimized,
and omits many desirab... |
videos_3b1b/_2017/nn/part3.py | from _2017.nn.network import *
from _2017.nn.part1 import *
from _2017.nn.part2 import *
class LayOutPlan(Scene):
def construct(self):
title = OldTexText("Plan")
title.scale(1.5)
title.to_edge(UP)
h_line = Line(LEFT, RIGHT).scale(FRAME_X_RADIUS - 1)
h_line.next_to(title, DOW... |
videos_3b1b/_2017/nn/playground.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os.path
from functools import reduce
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from constants import *
from manim_imports_ext import *
from _2017.nn.network import *
from _2017.nn.part1 import *
class Test(Scene):
def constru... |
videos_3b1b/_2017/nn/part2.py | import sys
import os.path
import cv2
from manim_imports_ext import *
from _2017.nn.network import *
from _2017.nn.part1 import *
POSITIVE_COLOR = BLUE
NEGATIVE_COLOR = RED
def get_training_image_group(train_in, train_out):
image = MNistMobject(train_in)
image.set_height(1)
arrow = Vector(RIGHT, color = ... |
videos_3b1b/once_useful_constructs/counting.py | from manimlib.animation.creation import ShowCreation
from manimlib.animation.fading import FadeIn
from manimlib.animation.transform import MoveToTarget
from manimlib.animation.transform import Transform
from manimlib.constants import *
from manimlib.mobject.geometry import Arrow
from manimlib.mobject.geometry import Ci... |
videos_3b1b/once_useful_constructs/graph_theory.py | from functools import reduce
import itertools as it
import operator as op
import numpy as np
from manimlib.constants import *
from manimlib.scene.scene import Scene
from manimlib.utils.rate_functions import there_and_back
from manimlib.utils.space_ops import center_of_mass
class Graph():
def __init__(self):
... |
videos_3b1b/once_useful_constructs/light.py | from traceback import *
from scipy.spatial import ConvexHull
from manimlib.animation.composition import LaggedStartMap
from manimlib.animation.fading import FadeIn
from manimlib.animation.fading import FadeOut
from manimlib.animation.transform import Transform
from manimlib.constants import *
from manimlib.mobject.ge... |
videos_3b1b/once_useful_constructs/homeless.py | from manim_imports_ext import *
class Cycloidify(Scene):
def construct(self):
def cart_to_polar(xxx_todo_changeme):
(x, y, z) = xxx_todo_changeme
return x*RIGHT+x*y*UP
def polar_to_cycloid(point):
epsilon = 0.00001
t = get_norm(point)
R = ... |
videos_3b1b/once_useful_constructs/region.py | from copy import deepcopy
import itertools as it
from manimlib.constants import *
from manimlib.mobject.mobject import Mobject
from manimlib.utils.iterables import adjacent_pairs
# Warning: This is all now pretty deprecated, and should not be expected to work
class Region(Mobject):
CONFIG = {
"display_m... |
videos_3b1b/once_useful_constructs/sample_space_scene.py | from manimlib.animation.animation import Animation
from manimlib.animation.transform import MoveToTarget
from manimlib.animation.transform import Transform
from manimlib.animation.update import UpdateFromFunc
from manimlib.constants import DOWN, RIGHT
from manimlib.constants import MED_LARGE_BUFF, SMALL_BUFF
from manim... |
videos_3b1b/once_useful_constructs/arithmetic.py | import numpy as np
from manimlib.animation.animation import Animation
from manimlib.mobject.mobject import Mobject
from manimlib.constants import *
from manimlib.mobject.svg.tex_mobject import Tex
from manimlib.scene.scene import Scene
from manimlib.utils.paths import path_along_arc
class RearrangeEquation(Scene):
... |
videos_3b1b/once_useful_constructs/sed.py | from manim_imports_ext import *
import csv
import time
from datetime import datetime
class SEDTest(MovingCameraScene):
def construct(self):
file_name1 = "/Users/grant/Desktop/SED_launch_data.csv"
file_name2 = "/Users/grant/Desktop/SED_scrub_data.csv"
times = []
heart_rates = []
... |
videos_3b1b/once_useful_constructs/graph_scene.py | import itertools as it
from manimlib.animation.creation import Write, DrawBorderThenFill, ShowCreation
from manimlib.animation.transform import Transform
from manimlib.animation.update import UpdateFromAlphaFunc
from manimlib.constants import *
from manimlib.mobject.functions import ParametricCurve
from manimlib.mobje... |
videos_3b1b/once_useful_constructs/dict_shenanigans.py | import inspect
from manimlib.utils.dict_ops import merge_dicts_recursively
def filtered_locals(caller_locals):
result = caller_locals.copy()
ignored_local_args = ["self", "kwargs"]
for arg in ignored_local_args:
result.pop(arg, caller_locals)
return result
def digest_config(obj, kwargs, call... |
videos_3b1b/once_useful_constructs/linear_algebra.py | from __future__ import annotations
import itertools as it
import numpy as np
from manimlib.constants import DEFAULT_MOBJECT_TO_MOBJECT_BUFFER
from manimlib.constants import LEFT, RIGHT
from manimlib.constants import WHITE
from manimlib.mobject.shape_matchers import BackgroundRectangle
from manimlib.mobject.svg.tex_m... |
videos_3b1b/once_useful_constructs/reconfigurable_scene.py | from manimlib.animation.transform import Transform
from manimlib.constants import *
from manimlib.mobject.mobject import Mobject
from manimlib.scene.scene import Scene
class ReconfigurableScene(Scene):
"""
Note, this seems to no longer work as intented.
"""
CONFIG = {
"allow_recursion": True,
... |
videos_3b1b/once_useful_constructs/fractals.py | from functools import reduce
import random
from manimlib.constants import *
# from manimlib.for_3b1b_videos.pi_creature import PiCreature
# from manimlib.for_3b1b_videos.pi_creature import Randolph
# from manimlib.for_3b1b_videos.pi_creature import get_all_pi_creature_modes
from manimlib.mobject.geometry import Circle... |
videos_3b1b/once_useful_constructs/matrix_multiplication.py | import numpy as np
from manimlib.animation.creation import ShowCreation
from manimlib.animation.fading import FadeOut
from manimlib.animation.transform import ApplyMethod
from manimlib.animation.transform import Transform
from manimlib.constants import *
from manimlib.mobject.geometry import Circle
from manimlib.mobje... |
videos_3b1b/once_useful_constructs/butterfly_curve.py | from manim_imports_ext import *
class RotatingButterflyCurve(Animation):
"""
Pretty hacky, but should only be redone in the context
of a broader 4d mobject class
"""
CONFIG = {
"space_epsilon": 0.002,
"grid_line_sep": 0.2,
"radius": 2,
"radians": 2 * np.pi,
... |
videos_3b1b/once_useful_constructs/combinatorics.py | from manimlib.constants import *
from manimlib.mobject.numbers import Integer
from manimlib.mobject.svg.tex_mobject import Tex
from manimlib.mobject.types.vectorized_mobject import VMobject, VGroup
from manimlib.scene.scene import Scene
from manimlib.utils.simple_functions import choose
DEFAULT_COUNT_NUM_OFFSET = (FR... |
videos_3b1b/once_useful_constructs/complex_transformation_scene.py | from manimlib.animation.animation import Animation
from manimlib.animation.movement import ComplexHomotopy
from manimlib.animation.transform import MoveToTarget
from manimlib.constants import *
from manimlib.mobject.coordinate_systems import ComplexPlane
from manimlib.mobject.types.vectorized_mobject import VGroup
from... |
videos_3b1b/once_useful_constructs/vector_space_scene.py | import numpy as np
from manimlib.animation.animation import Animation
from manimlib.animation.creation import ShowCreation
from manimlib.animation.creation import Write
from manimlib.animation.fading import FadeOut
from manimlib.animation.growing import GrowArrow
from manimlib.animation.transform import ApplyFunction
... |
videos_3b1b/custom/filler.py | from manimlib.scene.scene import Scene
class ExternallyAnimatedScene(Scene):
def construct(self):
raise Exception("Don't actually run this class.")
|
videos_3b1b/custom/logo.py | from __future__ import annotations
import numpy as np
import itertools as it
import random
from manimlib.constants import *
from manimlib.scene.scene import Scene
from manimlib.mobject.geometry import AnnularSector
from manimlib.mobject.geometry import Circle
from manimlib.mobject.geometry import Polygon
from maniml... |
videos_3b1b/custom/drawings.py | from manimlib import *
# Related to pi creatures
class Car(SVGMobject):
file_name = "Car"
height = 1
color = GREY_B
light_colors = [BLACK, BLACK]
def __init__(self, **kwargs):
SVGMobject.__init__(self, **kwargs)
path = self.submobjects[0]
subpaths = path.get_subpaths()
... |
videos_3b1b/custom/backdrops.py | from manimlib.constants import WHITE
from manimlib.constants import BLACK
from manimlib.constants import DOWN
from manimlib.constants import UP
from manimlib.constants import BLUE
from manimlib.scene.scene import Scene
from manimlib.mobject.frame import FullScreenRectangle
from manimlib.mobject.frame import ScreenRecta... |
videos_3b1b/custom/end_screen.py | import random
import os
import json
from tqdm import tqdm as ProgressDisplay
from manimlib.animation.animation import Animation
from manimlib.animation.composition import Succession
from manimlib.animation.transform import ApplyMethod
from manimlib.constants import *
from manimlib.mobject.mobject import Mobject
from ... |
videos_3b1b/custom/opening_quote.py | from manimlib.animation.creation import Write
from manimlib.animation.fading import FadeIn
from manimlib.constants import *
from manimlib.mobject.svg.tex_mobject import TexText
from manimlib.scene.scene import Scene
from manimlib.utils.rate_functions import linear
class OpeningQuote(Scene):
quote = []
quote_a... |
videos_3b1b/custom/deprecated.py | # This file contains functions and classes which have been used in old
# videos, but which have since been supplanted in manim. For example,
# there were previously various specifically named classes for version
# of fading which are now covered by arguments passed into FadeIn and
# FadeOut
from manimlib.animation.fa... |
videos_3b1b/custom/banner.py | from __future__ import annotations
from manimlib.constants import *
from manimlib.mobject.coordinate_systems import NumberPlane
from manimlib.mobject.svg.tex_mobject import TexText
from manimlib.mobject.svg.text_mobject import Text
from manimlib.mobject.types.vectorized_mobject import VGroup
from manimlib.mobject.fram... |
videos_3b1b/custom/characters/pi_creature_scene.py | from __future__ import annotations
from collections.abc import Iterable
import random
from manimlib.animation.transform import ReplacementTransform
from manimlib.animation.transform import Transform
from manimlib.animation.transform import ApplyMethod
from manimlib.animation.composition import LaggedStart
from maniml... |
videos_3b1b/custom/characters/pi_creature.py | from __future__ import annotations
import os
import logging
import numpy as np
from manimlib.animation.animation import Animation
from manimlib.animation.composition import AnimationGroup
from manimlib.animation.fading import FadeTransform
from manimlib.animation.transform import ReplacementTransform
from manimlib.c... |
videos_3b1b/custom/characters/pi_creature_animations.py | from __future__ import annotations
from manimlib.animation.composition import AnimationGroup
from manimlib.animation.fading import FadeOut
from manimlib.animation.creation import DrawBorderThenFill
from manimlib.animation.creation import Write
from manimlib.animation.transform import ApplyMethod
from manimlib.animatio... |
videos_3b1b/_2016/zeta.py | from manim_imports_ext import *
import mpmath
mpmath.mp.dps = 7
def zeta(z):
max_norm = FRAME_X_RADIUS
try:
return np.complex(mpmath.zeta(z))
except:
return np.complex(max_norm, 0)
def d_zeta(z):
epsilon = 0.01
return (zeta(z + epsilon) - zeta(z))/epsilon
class ComplexTransfor... |
videos_3b1b/_2016/patreon.py | from manim_imports_ext import *
class SideGigToFullTime(Scene):
def construct(self):
morty = Mortimer()
morty.next_to(ORIGIN, DOWN)
self.add(morty)
self.side_project(morty)
self.income(morty)
self.full_time(morty)
def side_project(self, morty):
rect = ... |
videos_3b1b/_2016/wcat.py | from manim_imports_ext import *
class ClosedLoopScene(Scene):
CONFIG = {
"loop_anchor_points" : [
3*RIGHT,
2*RIGHT+UP,
3*RIGHT + 3*UP,
UP,
2*UP+LEFT,
2*LEFT + 2*UP,
3*LEFT,
2*LEFT+DOWN,
3*LEFT+2*DOW... |
videos_3b1b/_2016/hanoi.py | from manim_imports_ext import *
class CountingScene(Scene):
CONFIG = {
"base" : 10,
"power_colors" : [YELLOW, MAROON_B, RED, GREEN, BLUE, PURPLE_D],
"counting_dot_starting_position" : (FRAME_X_RADIUS-1)*RIGHT + (FRAME_Y_RADIUS-1)*UP,
"count_dot_starting_radius" : 0.5,
"dot_c... |
videos_3b1b/_2016/fractal_charm.py | from manim_imports_ext import *
class FractalCreation(Scene):
CONFIG = {
"fractal_class" : PentagonalFractal,
"max_order" : 5,
"transform_kwargs" : {
"path_arc" : np.pi/6,
"lag_ratio" : 0.5,
"run_time" : 2,
},
"fractal_kwargs" : {},
}
... |
videos_3b1b/_2016/triangle_of_power/triangle.py | import numbers
from manim_imports_ext import *
from functools import reduce
OPERATION_COLORS = [YELLOW, GREEN, BLUE_B]
def get_equation(index, x = 2, y = 3, z = 8, expression_only = False):
assert(index in [0, 1, 2])
if index == 0:
tex1 = "\\sqrt[%d]{%d}"%(y, z),
tex2 = " = %d"%x
elif ind... |
videos_3b1b/_2016/triangle_of_power/end.py | from manim_imports_ext import *
from _2016.triangle_of_power.triangle import TOP, OPERATION_COLORS
class DontLearnFromSymbols(Scene):
def construct(self):
randy = Randolph().to_corner()
bubble = randy.get_bubble()
bubble.content_scale_factor = 0.6
bubble.add_content(TOP(2, 3, 8).sc... |
videos_3b1b/_2016/triangle_of_power/intro.py | from manim_imports_ext import *
class TrigAnimation(Animation):
CONFIG = {
"rate_func" : None,
"run_time" : 5,
"sin_color" : BLUE,
"cos_color" : RED,
"tan_color" : GREEN
}
def __init__(self, **kwargs):
digest_config(self, kwargs)
x_axis = NumberLine... |
videos_3b1b/_2016/hilbert/section2.py | from manim_imports_ext import *
import displayer as disp
from hilbert.curves import \
TransformOverIncreasingOrders, FlowSnake, HilbertCurve, \
SnakeCurve, PeanoCurve
from hilbert.section1 import get_mathy_and_bubble
from scipy.spatial.distance import cdist
def get_time_line():
length = 2.6*FRAME_WIDTH
... |
videos_3b1b/_2016/hilbert/fractal_porn.py | from manim_imports_ext import *
from from_3b1b.old.hilbert.curves import *
class Intro(TransformOverIncreasingOrders):
@staticmethod
def args_to_string(*args):
return ""
@staticmethod
def string_to_args(string):
raise Exception("string_to_args Not Implemented!")
def constr... |
videos_3b1b/_2016/hilbert/section3.py | from manim_imports_ext import *
import displayer as disp
from hilbert.curves import \
TransformOverIncreasingOrders, FlowSnake, HilbertCurve, \
SnakeCurve, Sierpinski
from hilbert.section1 import get_mathy_and_bubble
class SectionThree(Scene):
def construct(self):
self.add(OldTexText("A few wor... |
videos_3b1b/_2016/hilbert/section1.py | from manim_imports_ext import *
import displayer as disp
from hilbert.curves import \
TransformOverIncreasingOrders, FlowSnake, HilbertCurve, \
SnakeCurve
from constants import *
def get_grid():
return Grid(64, 64)
def get_freq_line():
return UnitInterval().shift(2*DOWN) ##Change?
def get_mathy... |
videos_3b1b/_2016/brachistochrone/multilayered.py | import numpy as np
import itertools as it
from manim_imports_ext import *
from from_3b1b.old.brachistochrone.light import PhotonScene
from from_3b1b.old.brachistochrone.curves import *
class MultilayeredScene(Scene):
CONFIG = {
"n_layers" : 5,
"top_color" : BLUE_E,
"bottom_color" : BLUE_A... |
videos_3b1b/_2016/brachistochrone/cycloid.py | from manim_imports_ext import *
from from_3b1b.old.brachistochrone.curves import *
class RollAlongVector(Animation):
CONFIG = {
"rotation_vector" : OUT,
}
def __init__(self, mobject, vector, **kwargs):
radius = mobject.get_width()/2
radians = get_norm(vector)/radius
last_alp... |
videos_3b1b/_2016/brachistochrone/curves.py | from manim_imports_ext import *
RANDY_SCALE_FACTOR = 0.3
class Cycloid(ParametricCurve):
CONFIG = {
"point_a" : 6*LEFT+3*UP,
"radius" : 2,
"end_theta" : 3*np.pi/2,
"density" : 5*DEFAULT_POINT_DENSITY_1D,
"color" : YELLOW
}
def __init... |
videos_3b1b/_2016/brachistochrone/light.py | import numpy as np
import itertools as it
from manim_imports_ext import *
from from_3b1b.old.brachistochrone.curves import \
Cycloid, PathSlidingScene, RANDY_SCALE_FACTOR, TryManyPaths
class Lens(Arc):
CONFIG = {
"radius" : 2,
"angle" : np.pi/2,
"color" : BLUE_B,
}
def __init... |
videos_3b1b/_2016/brachistochrone/wordplay.py | import numpy as np
import itertools as it
import os
from manim_imports_ext import *
from from_3b1b.old.brachistochrone.drawing_images import sort_by_color
class Intro(Scene):
def construct(self):
logo = ImageMobject("LogoGeneration", invert = False)
name_mob = OldTexText("3Blue1Brown").center()
... |
videos_3b1b/_2016/brachistochrone/drawing_images.py | import numpy as np
import itertools as it
import operator as op
import sys
import inspect
from PIL import Image
import cv2
import random
from scipy.spatial.distance import cdist
from scipy import ndimage
from manim_imports_ext import *
DEFAULT_GAUSS_BLUR_CONFIG = {
"ksize" : (5, 5),
"sigmaX" : 6,
"sig... |
videos_3b1b/_2016/brachistochrone/graveyard.py | import numpy as np
import itertools as it
from manim_imports_ext import *
from from_3b1b.old.brachistochrone.curves import Cycloid
class MultilayeredGlass(PhotonScene, ZoomedScene):
CONFIG = {
"num_discrete_layers" : 5,
"num_variables" : 3,
"top_color" : BLUE_E,
"bottom_color" : B... |
videos_3b1b/_2016/brachistochrone/misc.py | import numpy as np
import itertools as it
from manim_imports_ext import *
from from_3b1b.old.brachistochrone.curves import Cycloid
class PhysicalIntuition(Scene):
def construct(self):
n_terms = 4
def func(xxx_todo_changeme):
(x, y, ignore) = xxx_todo_changeme
z = complex(x,... |
videos_3b1b/_2016/eola/chapter6.py | from manim_imports_ext import *
from ka_playgrounds.circuits import Resistor, Source, LongResistor
class OpeningQuote(Scene):
def construct(self):
words = OldTexText(
"To ask the",
"right question\\\\",
"is harder than to answer it."
)
words.to_edge(UP)
... |
videos_3b1b/_2016/eola/chapter3.py | from manim_imports_ext import *
def curvy_squish(point):
x, y, z = point
return (x+np.cos(y))*RIGHT + (y+np.sin(x))*UP
class OpeningQuote(Scene):
def construct(self):
words = OldTexText([
"Unfortunately, no one can be told what the",
"Matrix",
"is. You have to",... |
videos_3b1b/_2016/eola/chapter9.py | from manim_imports_ext import *
from _2016.eola.chapter1 import plane_wave_homotopy
V_COLOR = YELLOW
class Jennifer(PiCreature):
CONFIG = {
"color" : PINK,
"start_corner" : DOWN+LEFT,
}
class You(PiCreature):
CONFIG = {
"color" : BLUE_E,
"start_corner" : DOWN+RIGHT,
... |
videos_3b1b/_2016/eola/chapter2.py | from manim_imports_ext import *
from _2016.eola.chapter1 import plane_wave_homotopy
class OpeningQuote(Scene):
def construct(self):
words = OldTexText("""
Mathematics requires a small dose, not of genius,
but of an imaginative freedom which, in a larger
dose, would be ... |
videos_3b1b/_2016/eola/chapter11.py | from manim_imports_ext import *
from _2016.eola.chapter1 import plane_wave_homotopy
from _2016.eola.chapter3 import ColumnsToBasisVectors
from _2016.eola.chapter5 import NameDeterminant, Blob
from _2016.eola.chapter9 import get_small_bubble
from _2016.eola.chapter10 import ExampleTranformationScene
class Student(PiCre... |
videos_3b1b/_2016/eola/footnote2.py | from manim_imports_ext import *
from ka_playgrounds.circuits import Resistor, Source, LongResistor
class OpeningQuote(Scene):
def construct(self):
words = OldTexText(
"``On this quiz, I asked you to find the determinant of a",
"2x3 matrix.",
"Some of you, to my great am... |
videos_3b1b/_2016/eola/chapter8.py | from manim_imports_ext import *
from _2016.eola.chapter5 import get_det_text, RightHandRule
U_COLOR = ORANGE
V_COLOR = YELLOW
W_COLOR = MAROON_B
P_COLOR = RED
def get_vect_tex(*strings):
result = ["\\vec{\\textbf{%s}}"%s for s in strings]
if len(result) == 1:
return result[0]
else:
return... |
videos_3b1b/_2016/eola/chapter10.py | from manim_imports_ext import *
from _2016.eola.chapter1 import plane_wave_homotopy
from _2016.eola.chapter3 import ColumnsToBasisVectors
from _2016.eola.chapter5 import get_det_text
from _2016.eola.chapter9 import get_small_bubble
class OpeningQuote(Scene):
def construct(self):
words = OldTexText(
... |
videos_3b1b/_2016/eola/chapter7.py | from manim_imports_ext import *
from _2016.eola.footnote2 import TwoDTo1DTransformWithDots
V_COLOR = YELLOW
W_COLOR = MAROON_B
SUM_COLOR = PINK
def get_projection(vector_to_project, stable_vector):
v1, v2 = stable_vector, vector_to_project
return v1*np.dot(v1, v2)/(get_norm(v1)**2)
def get_vect_mob_project... |
videos_3b1b/_2016/eola/chapter5.py | from manim_imports_ext import *
from _2016.eola.chapter3 import MatrixVectorMultiplicationAbstract
class Blob(Circle):
CONFIG = {
"stroke_color" : TEAL,
"fill_color" : BLUE_E,
"fill_opacity" : 1,
"random_seed" : 1,
"random_nudge_size" : 0.5,
"height" : 2,
}
... |
videos_3b1b/_2016/eola/thumbnails.py | from manim_imports_ext import *
from _2016.eola.chapter9 import Jennifer, You
class Chapter0(LinearTransformationScene):
CONFIG = {
"include_background_plane" : False,
"t_matrix" : [[3, 1], [2, -1]]
}
def construct(self):
self.setup()
self.plane.fade()
for mob in sel... |
videos_3b1b/_2016/eola/chapter8p2.py | from manim_imports_ext import *
from _2016.eola.chapter5 import get_det_text
from _2016.eola.chapter8 import *
class OpeningQuote(Scene):
def construct(self):
words = OldTexText(
"From [Grothendieck], I have also learned not",
"to take glory in the ",
"difficulty of a ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.