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/1271400215525724162/1271400215525724162 | |
from manim import * | |
class coordNumber(Scene): | |
def construct(self): | |
ax = NumberPlane().add_coordinates() | |
self.add(ax) | |
x = ValueTracker(1) | |
y = ValueTracker(1) | |
cdisp = always_redraw(lambda: |
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/1268142621180690483/1268142621180690483 | |
from manim import * | |
class SlideUpLetterByLetter(Animation): | |
def __init__( | |
self, | |
text: Text, | |
lag: float=0.4, | |
buff: float = 0.0, | |
**kwargs, |
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 * | |
# https://discord.com/channels/581738731934056449/1174899083949899866/1175046975662604358 | |
# by Abulafia | |
def mark_line(line, n_marks=1, length=0.3, distance=0.1, color=RED): | |
marks = VGroup(*[Line(ORIGIN, length*UP, color=color) for _ in range(n_marks)]) | |
marks.arrange(RIGHT, buff=distance) | |
marks.rotate(line.get_angle()) | |
marks.move_to(line.get_center()) | |
return marks |
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/1216636172277776435/1216684543042650142 | |
from scipy.optimize import root_scalar | |
# uwezi intersection method | |
class question(Scene): | |
def construct(self): | |
t_dn = DecimalNumber(-5).to_edge(UR) | |
# x^3 - 4x | |
def f(x): | |
return (x-2) * x * (x+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
def H(z,a,b,l): | |
''' | |
from https://codegolf.stackexchange.com/questions/11767/the-centers-of-a-triangle | |
1 - Incenter | |
2 - Centroid | |
3 - Circumcenter | |
4 - Orthocenter | |
5 - Equation of Euler Line | |
(if the Euler Line is vertical, output the `x` value of the line |
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 scipy import signal | |
class stepResponse(Scene): | |
def construct(self): | |
T = np.linspace(0,10,1000) | |
sys = signal.TransferFunction([1,3,3], [1,2,1]) | |
t, y1 = sys.impulse(T=T) | |
t, y2 = sys.step(T=T) | |
ax = Axes( | |
x_range=[-1,12,1], | |
x_length=[13], |
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 * | |
# by dudewaldo4 | |
# https://discord.com/channels/581738731934056449/976376734935048223/1161709114154569819 | |
# https://www.youtube.com/watch?v=Bg999qefIic | |
# | |
def ir(a,b): # inclusive range, useful for TransformByGlyphMap | |
return list(range(a,b+1)) |
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 * | |
# https://discord.com/channels/581738731934056449/1096718885606150154/1096718885606150154 | |
class arc3d(VMobject): | |
def __init__(self, A=None, B=None, center=None, radius=1, segments=40, **kwargs): | |
super().__init__(**kwargs) | |
start = center + (A-center)*radius/np.linalg.norm(A-center) | |
end = center + (B-center)*radius/np.linalg.norm(B-center) | |
self.set_points([start]) | |
for i in np.linspace(0,1,segments,endpoint=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.mobject.text.numbers import string_to_mob_map as cache | |
# https://discord.com/channels/581738731934056449/1243063440206073907/1243210818837811230 | |
class numText(Text): | |
def __init__(self, text: str, **kwargs) -> None: | |
print('hello') | |
super().__init__(text, font="Roboto", **kwargs) | |
class Test(Scene): | |
def construct(self): |
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 inoutcircleTriangle(Scene): | |
def construct(self): | |
triangle = VMobject() | |
incirc = VMobject() | |
outcirc = VMobject() | |
for i in range(5): | |
A = np.array([np.random.uniform(-5,5),np.random.uniform(-3,3),0]) | |
B = np.array([np.random.uniform(-5,5),np.random.uniform(-3,3),0]) | |
C = np.array([np.random.uniform(-5,5),np.random.uniform(-3,3),0]) | |
a = np.linalg.norm(B-C) |