file_path stringclasses 1
value | content stringlengths 0 219k |
|---|---|
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 ... | |
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... | |
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... | |
#!/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... | |
from manim_imports_ext import *
from _2022.wordle.simulations import *
# Scene types
class WordleScene(Scene):
n_letters = 5
grid_height = 6
font_to_square_height = 65
grid_center = ORIGIN
secret_word = None
color_map = {
0: "#797C7E", # GREY
1: "#C6B566", # YELLOW
... | |
from manim_imports_ext import *
from tqdm import tqdm as ProgressDisplay
from scipy.stats import entropy
MISS = np.uint8(0)
MISPLACED = np.uint8(1)
EXACT = np.uint8(2)
DATA_DIR = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
"data",
)
SHORT_WORD_LIST_FILE = os.path.join(DATA_DIR, "possible_words... | |
from manim_imports_ext import *
from _2022.wordle.scenes import *
class HeresTheThing(TeacherStudentsScene):
def construct(self):
thumbnail = ImageMobject(os.path.join(
self.file_writer.output_directory,
self.file_writer.get_default_module_directory(),
os.pardir,
... | |
from manim_imports_ext import *
import sympy
PRIME_COLOR = YELLOW
def get_primes(max_n=100):
pass
def get_prime_colors():
pass
# Scenes
class Intro(InteractiveScene):
def construct(self):
pass
class ShowPrimeDensity(InteractiveScene):
def construct(self):
# Setup
frame... | |
from manim_imports_ext import *
EQUATOR_STYLE = dict(stroke_color=TEAL, stroke_width=2)
def get_sphere_slices(radius=1.0, n_slices=20):
delta_theta = TAU / n_slices
north_slices = Group(*(
ParametricSurface(
uv_func=lambda u, v: [
radius * math.sin(v) * math.cos(u),
... | |
from manim_imports_ext import *
from _2022.piano.fourier_animations import DecomposeAudioSegment
from _2019.diffyq.part2.fourier_series import FourierCirclesScene
class DecomposeRoar_SlowFPS(DecomposeAudioSegment):
audio_file = "/Users/grant/Dropbox/3Blue1Brown/videos/2022/infinity/Roar.wav"
graph_point = 0.4... | |
from manim_imports_ext import *
from _2022.quintic.roots_and_coefs import *
class CubicFormula(RootCoefScene):
coefs = [1, -1, 0, 1]
coef_plane_config = {
"x_range": (-2.0, 2.0),
"y_range": (-2.0, 2.0),
"background_line_style": {
"stroke_color": GREY,
"stroke_wi... | |
from manim_imports_ext import *
# Helpers
def roots_to_coefficients(roots):
n = len(list(roots))
return [
((-1)**(n - k)) * sum(
np.prod(tup)
for tup in it.combinations(roots, n - k)
)
for k in range(n)
] + [1]
def poly(x, coefs):
return sum(coefs[k] ... | |
from manim_imports_ext import *
from _2022.quintic.roots_and_coefs import *
# Introduction
class IntroduceUnsolvability(Scene):
def construct(self):
pass
class TableOfContents(Scene):
def construct(self):
pass
# Preliminaries on polynomials
class ConstructPolynomialWithGivenRoots(Scene)... | |
from manim_imports_ext import *
class AmbientPermutations(Scene):
def construct(self):
# Test
text = Text("abcde", font_size=72)
text.arrange_to_fit_width(4.5)
self.add(text)
# Animate swaps
n_swaps = 10
perms = list(it.permutations(range(len(text))))
... | |
from manim_imports_ext import *
ASSET_DIR = "/Users/grant/3Blue1Brown Dropbox/3Blue1Brown/videos/2022/galois/assets/"
class FlowerSymmetries(InteractiveScene):
flower_height = 6.3
def construct(self):
# Add flower
flower = ImageMobject(os.path.join(ASSET_DIR, "Flower"))
flower.set_h... | |
import mpmath
import sympy
from manim_imports_ext import *
def get_set_tex(values, max_shown=7, **kwargs):
if len(values) > max_shown:
value_mobs = [
*map(Integer, values[:max_shown - 2]),
Tex("\\dots"),
Integer(values[-1], group_with_commas=False),
]
else:
... | |
from manim_imports_ext import *
class IntersectionAndUnion(InteractiveScene):
def construct(self):
self.camera.frame.scale(1.1)
# Title
title = Text("Educational content creation by individuals", font_size=60)
title.to_edge(UP)
title_start = title.select_part("Educational c... | |
from manim_imports_ext import *
import pandas as pd
import requests
from _2021.some1_winners import AllVideosOrdered
DOC_DIR = os.path.join(get_output_dir(), "2022/some2/winners/")
def get_entry_tile():
rect = ScreenRectangle(height=1)
rect.set_fill(GREY_D, 1)
rect.set_stroke(WHITE, 1)
rect.set_glo... | |
from manim_imports_ext import *
import argparse
import matplotlib.pyplot as plt
import mido
from collections import namedtuple
from tqdm import tqdm as ProgressDisplay
from scipy.signal import fftconvolve
from scipy.signal import convolve
from scipy.signal import argrelextrema
from scipy.io import wavfile
from IPyt... | |
from manim_imports_ext import *
import mido
from _2022.piano.wav_to_midi import DATA_DIR
from _2022.piano.wav_to_midi import piano_midi_range
from _2022.piano.wav_to_midi import midi_to_wav
class AnimatedMidi(Scene):
midi_file = "3-16-attempts/Help_Long_as_piano_5ms.mid"
dist_per_sec = 4.0
bpm = 240
... | |
from manim_imports_ext import *
from _2022.piano.wav_to_midi import DATA_DIR
from scipy.io import wavfile
def get_wave_sum(axes, freqs, amplitudes=None, phases=None):
if amplitudes is None:
amplitudes = np.ones(len(freqs))
if phases is None:
phases = np.zeros(len(freqs))
return axes.get_g... | |
from manim_imports_ext import *
from _2022.borwein.main import *
# Pi creature scenes and quick supplements
class UniverseIsMessingWithYou(TeacherStudentsScene):
def construct(self):
pass
class ExpressAnger(TeacherStudentsScene):
def construct(self):
self.remove(self.background)
sel... | |
from manim_imports_ext import *
SUB_ONE_FACTOR = "0.99999999998529"
def sinc(x):
return np.sinc(x / PI)
def multi_sinc(x, n):
return np.prod([sinc(x / (2 * k + 1)) for k in range(n)])
def rect_func(x):
result = np.zeros_like(x)
result[(-0.5 < x) & (x < 0.5)] = 1.0
return result
def get_fif... | |
from manim_imports_ext import *
from _2022.convolutions.discrete import *
class HoldUpLists(TeacherStudentsScene):
def construct(self):
self.remove(self.background)
self.play(
self.teacher.change("raise_right_hand", look_at=self.screen),
self.change_students("pondering", "t... | |
from __future__ import annotations
from manim_imports_ext import *
from _2022.borwein.main import *
import scipy.signal
def get_die_faces(**kwargs):
result = VGroup(*(DieFace(n, **kwargs) for n in range(1, 7)))
result.arrange(RIGHT, buff=MED_LARGE_BUFF)
return result
def get_aligned_pairs(group1, group... | |
#!/usr/bin/env python
import numpy as np
import itertools as it
from copy import deepcopy
import sys
from manim_imports_ext import *
ARROW_CONFIG = {"stroke_width" : 2*DEFAULT_STROKE_WIDTH}
LIGHT_RED = RED_E
def matrix_to_string(matrix):
return "--".join(["-".join(map(str, row)) for row in matrix])
def matrix_... | |
#!/usr/bin/env python
import numpy as np
import itertools as it
from copy import deepcopy
import sys
import operator as op
from random import sample
from manim_imports_ext import *
from script_wrapper import command_line_create_scene
from functools import reduce
# from inventing_math_images import *
MOVIE_PREFIX = ... | |
import numpy as np
import itertools as it
from copy import deepcopy
import sys
from constants import *
from scene.scene import Scene
from geometry import Polygon
from mobject.region import region_from_polygon_vertices, region_from_line_boundary
A_COLOR = BLUE
B_COLOR = MAROON_D
C_COLOR = YELLOW
TEX_MOB_SCALE_FACTO... | |
#!/usr/bin/env python
import numpy as np
import itertools as it
from copy import deepcopy
import sys
from animation import *
from mobject import *
from constants import *
from mobject.region import *
import displayer as disp
from scene.scene import Scene, GraphScene
from scene.graphs import *
from .moser_main impo... | |
#!/usr/bin/env python
import numpy as np
import itertools as it
from copy import deepcopy
import sys
from animation import *
from mobject import *
from constants import *
from mobject.region import *
from scene.scene import Scene, SceneFromVideo
from script_wrapper import command_line_create_scene
from functools i... | |
#!/usr/bin/env python
import numpy as np
import itertools as it
from copy import deepcopy
import sys
from manim_imports_ext import *
from script_wrapper import command_line_create_scene
MOVIE_PREFIX = "counting_in_binary/"
BASE_HAND_FILE = os.path.join(VIDEO_DIR, MOVIE_PREFIX, "Base.mp4")
FORCED_FRAME_DURATION = 0.... | |
#!/usr/bin/env python
import numpy as np
import itertools as it
import operator as op
from copy import deepcopy
from manim_imports_ext import *
RADIUS = FRAME_Y_RADIUS - 0.1
CIRCLE_DENSITY = DEFAULT_POINT_DENSITY_1D*RADIUS
def logo_to_circle():
from .generate_logo import DARK_BROWN, LOGO_RADIUS
sc = Scene... | |
#!/usr/bin/env python
import numpy as np
import itertools as it
from copy import deepcopy
import sys
from manim_imports_ext import *
from functools import reduce
DEFAULT_PLANE_CONFIG = {
"stroke_width" : 2*DEFAULT_STROKE_WIDTH
}
class SuccessiveComplexMultiplications(ComplexMultiplication):
args_list =... | |
#!/usr/bin/env python
import numpy as np
import itertools as it
from copy import deepcopy
import sys
from fractions import Fraction, gcd
from manim_imports_ext import *
from .inventing_math import Underbrace
import random
MOVIE_PREFIX = "music_and_measure/"
INTERVAL_RADIUS = 6
NUM_INTERVAL_TICKS = 16
TICK_STRETCH... | |
#!/usr/bin/env python
import numpy as np
import itertools as it
import operator as op
from copy import deepcopy
from random import random, randint
import sys
import inspect
from manim_imports_ext import *
from script_wrapper import command_line_create_scene
from functools import reduce
RADIUS = FRAME_Y_RA... | |
from manim_imports_ext import *
## Warning, much of what is in this class
## likely not supported anymore.
def drag_pixels(frames):
curr = frames[0]
new_frames = []
for frame in frames:
curr += (curr == 0) * np.array(frame)
new_frames.append(np.array(curr))
return new_frames
class L... | |
#!/usr/bin/env python
import numpy as np
import itertools as it
from copy import deepcopy
import sys
from manim_imports_ext import *
from script_wrapper import command_line_create_scene
from .generate_logo import LogoGeneration
POEM_LINES = """Fixed poorly in notation with that two,
you shine so loud that you deser... | |
#!/usr/bin/env python
import numpy as np
import itertools as it
from copy import deepcopy
import sys
from manim_imports_ext import *
from script_wrapper import command_line_create_scene
from .inventing_math import divergent_sum, draw_you
class SimpleText(Scene):
args_list = [
("Build the foundation o... | |
import numpy as np
import itertools as it
from mobject.mobject import Mobject, Mobject1D, Mobject2D, Mobject
from geometry import Line
from constants import *
class OldStars(Mobject1D):
CONFIG = {
"stroke_width" : 1,
"radius" : FRAME_X_RADIUS,
"num_points" : 1000,
}
d... | |
from manim_imports_ext import *
def half_plane():
plane = NumberPlane(
x_radius = FRAME_X_RADIUS/2,
x_unit_to_spatial_width = 0.5,
y_unit_to_spatial_height = 0.5,
x_faded_line_frequency = 0,
y_faded_line_frequency = 0,
density = 4*DEFAULT_POINT_DENSITY_1D,
)
... | |
from manim_imports_ext import *
class FluidFlow(Scene):
CONFIG = {
"vector_spacing" : 1,
"dot_spacing" : 0.5,
"dot_color" : BLUE_C,
"text_color" : WHITE,
"vector_color" : YELLOW,
"vector_length" : 0.5,
"points_height" : FRAME_Y_RADIUS,
"points_width"... | |
#!/usr/bin/env python
from manim_imports_ext import *
from zeta import *
class ExampleLinearTransformation(LinearTransformationScene):
CONFIG = {
"show_coordinates" : True
}
def construct(self):
self.wait()
self.apply_transposed_matrix([[2, 1], [-3, 1]])
self.wait()
def ex... | |
#!/usr/bin/env python
from manim_imports_ext import *
class VectorDraw(Animation):
CONFIG = {
"vector_color" : GREEN_B,
"line_color" : YELLOW,
"t_min" : 0,
"t_max" : 10,
"run_time" : 7,
}
def __init__(self, func, **kwargs):
digest_config(self, kwargs, loc... | |
from manim_imports_ext import *
class Resistor(Line):
def init_points(self):
midpoints = [
interpolate(self.start, self.end, alpha)
for alpha in [0.25]+list(np.arange(0.3, 0.71, 0.1))+[0.75]
]
perp = rotate_vector(self.end-self.start, np.pi/2)
for midpoint, n... | |
from manim_imports_ext import *
class StacksApproachBellCurve(Scene):
CONFIG = {
"n_iterations": 70,
}
def construct(self):
bar = Square(side_length=1)
bar.set_fill(BLUE, 1)
bar.set_stroke(BLUE, 1)
bars = VGroup(bar)
max_width = FRAME_WIDTH - 2
max... | |
from manim_imports_ext import *
class HyperSlinky(Scene):
def construct(self):
self.play(
ApplyPointwiseFunction(
lambda x_y_z: (1 + x_y_z[1]) * np.array((
np.cos(2 * np.pi * x_y_z[0]),
np.sin(2 * np.pi * x_y_z[0]),
x_... | |
from manim_imports_ext import *
class VennDiagram(InteractiveScene):
def construct(self):
# Add circles
radius = 3.0
c1, c2 = circles = Circle(radius=radius).replicate(2)
c1.set_stroke(BLUE, 3)
c2.set_stroke(YELLOW, 3)
c1.move_to(radius * LEFT / 2)
c2.move_t... | |
from manim_imports_ext import *
class PodcastIntro(Scene):
def construct(self):
tower = self.get_radio_tower()
n_rings = 15
min_radius = 0.5
max_radius = 9
max_width = 20
min_width = 0
max_opacity = 1
min_opacity = 0
rings = VGroup(*(
... | |
from manim_imports_ext import *
class PascalColored(Scene):
CONFIG = {
"colors": [BLUE_E, BLUE_D, BLUE_B],
"dot_radius": 0.16,
"n_layers": 2 * 81,
"rt_reduction_factor": 0.5,
}
def construct(self):
max_height = 6
rt = 1.0
layers = self.get_dots(sel... | |
from manim_imports_ext import *
class FakeAreaManipulation(Scene):
CONFIG = {
"unit": 0.5
}
def construct(self):
unit = self.unit
group1, group2 = groups = self.get_diagrams()
for group in groups:
group.set_width(10 * unit, stretch=True)
group.set_h... | |
from manim_imports_ext import *
class MugToTorus(ThreeDScene):
def construct(self):
frame = self.camera.frame
frame.reorient(-20, 60)
R1, R2 = (2, 0.75)
def torus_func(u, v):
v1 = np.array([-math.sin(u), 0, math.cos(u)])
v2 = math.cos(v) * v1 + math.sin(v)... | |
from manim_imports_ext import *
class DemoScene(InteractiveScene):
def construct(self):
# Demo animation
square = Square()
square.set_fill(BLUE, 0.5)
square.set_stroke(WHITE, 1)
grid = square.get_grid(10, 10, buff=0.5)
grid.set_height(7)
labels = index_lab... | |
from manim_imports_ext import *
class CleanBanner(Banner):
message = " "
class ShortsBanner(Banner):
message = "3b1b shorts"
def get_pis(self):
pis = VGroup(
Randolph(color=BLUE_E, mode="pondering"),
Randolph(color=BLUE_D, mode="hooray"),
Randolph(color=BLUE_... | |
from manim_imports_ext import *
class DoingMathVsHowMathIsPresented(Scene):
def construct(self):
titles = VGroup(
OldTexText("How math is presented"),
OldTexText("Actually doing math"),
)
for title, vect in zip(titles, [LEFT, RIGHT]):
title.scale(1.2)
... | |
from manim_imports_ext import *
class LinalgThumbnail(ThreeDScene):
CONFIG = {
"camera_config": {
"anti_alias_width": 0,
}
}
def construct(self):
grid = NumberPlane((-10, 10), (-10, 10), faded_line_ratio=1)
grid.set_stroke(width=6)
grid.faded_lines.set_... | |
from manim_imports_ext import *
class QBitDiagram(InteractiveScene):
def construct(self):
# Axes
axes = Axes(
(-1.5, 1.5, 0.5), (-1.5, 1.5, 0.5),
height=7,
width=7,
)
axes.set_height(7)
x_label = Tex(R"|0\rangle")
y_label = Tex(R... | |
from manim_imports_ext import *
from manimlib.once_useful_constructs.fractals import *
# Fractal posters
class ShowHilbertCurve(Scene):
CONFIG = {
"FractalClass": HilbertCurve,
"orders": [3, 5, 7],
"stroke_widths": [20, 15, 7],
}
def construct(self):
curves = VGroup(*[
... | |
from manim_imports_ext import *
from _2016.zeta import zeta
def approx_exp(x, n):
return sum([
x**k / math.factorial(k)
for k in range(n + 1)
])
class ExpPlay(Scene):
def construct(self):
for n in [2, 4, 6, 8, 10]:
self.show_sum_up_to(n)
self.clear()
... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
from manim_imports_ext import *
from _2019.diffyq.part2.fourier_series import FourierOfTexPaths
# I'm guessing most of this needs to be fixed...
# class ComplexMorphingNames(ComplexTransformationScene):
class ComplexMorphingNames(Scene):
CONFIG = {
"patron_n... | |
from manim_imports_ext import *
class WhyPi(Scene):
def construct(self):
title = OldTexText("Why $\\pi$?")
title.scale(3)
title.to_edge(UP)
formula1 = OldTex(
"1 +"
"\\frac{1}{4} +"
"\\frac{1}{9} +"
"\\frac{1}{16} +"
"\\f... | |
from manim_imports_ext import *
class AdditionAnagram(Scene):
def construct(self):
words1 = Text("twelve + one", font_size=120)
words2 = Text("eleven + two", font_size=120)
VGroup(words1, words2).shift(DOWN)
twelve = words1.get_part_by_text("twelve")
one = words1.get_part_... | |
from manim_imports_ext import *
class DoorPuzzle(InteractiveScene):
def construct(self):
# Setup
squares = Square().get_grid(10, 10)
squares.set_stroke(WHITE, 1)
squares.set_height(FRAME_HEIGHT - 1)
labels = VGroup(*(
Integer(n, font_size=24).move_to(square)
... | |
from manim_imports_ext import *
def stereo_project_point(point, axis=0, r=1, max_norm=10000):
point = fdiv(point * r, point[axis] + r)
point[axis] = 0
norm = get_norm(point)
if norm > max_norm:
point *= max_norm / norm
return point
class StarryStarryNight(Scene):
def construct(self):... | |
from manim_imports_ext import *
# Broken, but fixable
class ImagesMod256(Scene):
CONFIG = {
}
def construct(self):
lion = ImageMobject("Lion")
lion.set_height(6)
lion.to_edge(DOWN)
integer = Integer(1)
expression = VGroup(
OldTex("n \\rightarrow"),
... | |
from manim_imports_ext import *
class PowersOfTwo(Scene):
def construct(self):
max_n = 22
self.colors = [
[BLUE_B, BLUE_D, BLUE_C, GREY_BROWN][n % 4]
for n in range(max_n)
]
def update_group(group, alpha):
n = int(interpolate(0, max_n, alpha))
... | |
from manim_imports_ext import *
def stereo_project_point(point, axis=0, r=1, max_norm=10000):
point = fdiv(point * r, point[axis] + r)
point[axis] = 0
norm = get_norm(point)
if norm > max_norm:
point *= max_norm / norm
return point
def sudanese_band_func(eta, phi):
z1 = math.sin(eta)... | |
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... | |
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,
... | |
#!/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
)))
... | |
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,... | |
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)
)
... | |
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
# ... | |
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,
... | |
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... | |
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... | |
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... | |
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... | |
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:
... | |
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... | |
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... | |
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... | |
#!/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)
... | |
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... | |
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... | |
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,
},
... | |
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... | |
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... | |
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 "... | |
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*... | |
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... | |
# -*- 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",... | |
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... | |
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 ... | |
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... | |
#!/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... | |
"""
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... | |
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... | |
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 = ... | |
"""
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.