Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion calc-backend/animation-gen/derivativeAnimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ def construct(self):

self.add(axes, axes_labels, func)
self.add(dot1,dot2,secant,tangent_label)
<<<<<<< HEAD:calc-frontend/src/Animations/derivativeAnimation.py
self.play(dx.animate.set_value(.001), run_time=1)
self.play(x.animate.set_value(1), run_time = 4)
self.play(x.animate.set_value(7), run_time = 4)
self.play(dx.animate.set_value(2), run_time = 1)

self.wait(3)
=======
self.play(x.animate(rate_func=linear).set_value(3), run_time = 1.5)
self.play(x.animate(rate_func=rush_from).set_value(1), run_time = 2)
self.play(x.animate(rate_func=rush_into).set_value(3), run_time = 2)
self.play(x.animate(rate_func=linear).set_value(5.5), run_time = 1.5)
self.play(x.animate(rate_func=linear).set_value(5.5), run_time = 1.5)
>>>>>>> fabfda6e62f84d1215fa9f2e0e846c48e9fbb0ed:calc-backend/animation-gen/derivativeAnimation.py
21 changes: 15 additions & 6 deletions calc-backend/animation-gen/integralAnimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

class RightRiemannSum(Scene):
def construct(self):
<<<<<<< HEAD:calc-frontend/src/Animations/integralAnimations.py
axes = Axes(
=======
# Create axes
axes = (Axes(
>>>>>>> fabfda6e62f84d1215fa9f2e0e846c48e9fbb0ed:calc-backend/animation-gen/integralAnimation.py
x_range=[0, 2.5, 1],
y_range=[0, 5, 1],
x_length=10,
Expand All @@ -14,24 +18,26 @@ def construct(self):
.set_color(GRAY_A)
)

<<<<<<< HEAD:calc-frontend/src/Animations/integralAnimations.py
x_label = axes.get_x_axis_label("x")
y_label = axes.get_y_axis_label("y")
=======
# Axis labels
x_label = axes.get_x_axis_label("x").set_color(GRAY_A)
y_label = axes.get_y_axis_label("y").set_color(GRAY_A)
>>>>>>> fabfda6e62f84d1215fa9f2e0e846c48e9fbb0ed:calc-backend/animation-gen/integralAnimation.py

self.add(axes, x_label, y_label)

# Plot y = 0.6 * x^2 from 0 to 2.6
graph = axes.plot(lambda x: 0.6 * x**2, x_range=[0, 2.3], color=WHITE)
self.play(Create(graph), run_time=1)

# Riemann sum parameters
a, b = 0, 2
n = 10
dx = (b - a) / n
rectangles = VGroup()
area_sum = 0

# Create rectangles using f(x) = 0.6 * x^2
for i in range(1, n + 1):
x_right = a + i * dx
height = 0.6 * x_right**2
Expand All @@ -51,21 +57,24 @@ def construct(self):
rect.align_to(rect_corner, DOWN + LEFT)
rectangles.add(rect)

<<<<<<< HEAD:calc-frontend/src/Animations/integralAnimations.py
=======
# Animate rectangles fading in one-by-one
>>>>>>> fabfda6e62f84d1215fa9f2e0e846c48e9fbb0ed:calc-backend/animation-gen/integralAnimation.py
for rect in rectangles:
self.play(FadeIn(rect, run_time=0.15))

# Show area label in top-right corner
area_text = Text(f"Area ≈ {area_sum:.2f}", font_size=36)
area_text.to_edge(UP).shift(DOWN*2.4 + LEFT * 3.5)
self.play(Write(area_text))

self.wait(1.5)

# Fade everything out

self.play(
FadeOut(rectangles),
FadeOut(area_text),
FadeOut(graph),
run_time=1
)

self.wait(3)
81 changes: 81 additions & 0 deletions calc-backend/animation-gen/limitsAnimation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import numpy as np
from manim import *

class Limit(Scene):
def construct(self):

axes = Axes(
x_range=[0.1, 4, 1],
y_range=[0, 10, 2],
axis_config={"include_numbers": True},
x_length=8,
y_length=5
)
labels = axes.get_axis_labels(x_label="x", y_label="y")
self.play(Create(axes), Write(labels))

def func(x):
if x == 2:
return np.nan # removable discontinuity
return (x**2 + 4*x - 12)/(x**2 - 2*x)

graph = axes.plot(
func,
color=WHITE,
discontinuities=[2],
dt=0.01,
x_range=[.7,3.9]
)

hole_point = Circle(
radius=0.04,
color=WHITE,
fill_opacity=0,
stroke_width=4
).move_to(axes.c2p(2, func(2.01)))

self.play(Create(graph), FadeIn(hole_point), run_time=2)

def get_tangent_angle(x):
dx = 0.001
dy = func(x + dx) - func(x)
return np.arctan2(dy, dx)

t_left = ValueTracker(0.7)
t_right = ValueTracker(3.5)

left_arrow = Triangle(color=GREEN, fill_opacity=1).scale(0.2)
left_arrow.rotate(PI/2)
left_updater = always_redraw(
lambda: left_arrow.move_to(axes.c2p(t_left.get_value(), func(t_left.get_value())))
.set_angle(get_tangent_angle(t_left.get_value()))
)

right_arrow = Triangle(color=YELLOW, fill_opacity=1).scale(0.2)
right_arrow.rotate(PI/2)
right_updater = always_redraw(
lambda: right_arrow.move_to(axes.c2p(t_right.get_value(), func(t_right.get_value())))
.set_angle(get_tangent_angle(t_right.get_value()))
)

self.add(left_updater, right_updater)

self.play(
t_left.animate.set_value(1.99),
t_right.animate.set_value(2.01),
run_time=2,
rate_func=linear
)

self.wait(.5)

self.play(
FadeOut(axes),
FadeOut(labels),
FadeOut(graph),
FadeOut(hole_point),
FadeOut(left_arrow),
FadeOut(right_arrow)
)

self.wait(3)
35 changes: 10 additions & 25 deletions calc-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion calc-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@radix-ui/react-tooltip": "^1.2.0",
"@tailwindcss/vite": "^4.0.4",
"axios": "^1.8.1",
"better-auth": "^1.2.4",
"better-auth": "^1.2.7",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"jsdom": "^26.0.0",
Expand Down
Binary file not shown.
10 changes: 10 additions & 0 deletions calc-frontend/src/Animations/media/Tex/66e1bc57a83e0f07.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions calc-frontend/src/Animations/media/Tex/66e1bc57a83e0f07.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\documentclass[preview]{standalone}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{align*}
0
\end{align*}
\end{document}
16 changes: 16 additions & 0 deletions calc-frontend/src/Animations/media/Tex/70b3a8630e8c4922.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions calc-frontend/src/Animations/media/Tex/70b3a8630e8c4922.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\documentclass[preview]{standalone}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{align*}
f(x)
\end{align*}
\end{document}
10 changes: 10 additions & 0 deletions calc-frontend/src/Animations/media/Tex/b330e3953bf029d7.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions calc-frontend/src/Animations/media/Tex/b330e3953bf029d7.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\documentclass[preview]{standalone}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{align*}
6
\end{align*}
\end{document}
10 changes: 10 additions & 0 deletions calc-frontend/src/Animations/media/Tex/b47c9feb1c667bc8.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions calc-frontend/src/Animations/media/Tex/b47c9feb1c667bc8.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
\documentclass[preview]{standalone}
\usepackage[english]{babel}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}
\begin{align*}
8
\end{align*}
\end{document}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file is used internally by FFMPEG.
file 'file:/home/drake/CalculusVisualizerProject/calc-visualizer/calc-frontend/src/Animations/media/videos/limitsAnimation/1080p60/partial_movie_files/Limit/3529212410_1240247844_223132457.mp4'
file 'file:/home/drake/CalculusVisualizerProject/calc-visualizer/calc-frontend/src/Animations/media/videos/limitsAnimation/1080p60/partial_movie_files/Limit/3040924799_1376512726_2967433267.mp4'
file 'file:/home/drake/CalculusVisualizerProject/calc-visualizer/calc-frontend/src/Animations/media/videos/limitsAnimation/1080p60/partial_movie_files/Limit/3040924799_2510802644_4234489363.mp4'
file 'file:/home/drake/CalculusVisualizerProject/calc-visualizer/calc-frontend/src/Animations/media/videos/limitsAnimation/1080p60/partial_movie_files/Limit/3040924799_2341082278_384939764.mp4'
file 'file:/home/drake/CalculusVisualizerProject/calc-visualizer/calc-frontend/src/Animations/media/videos/limitsAnimation/1080p60/partial_movie_files/Limit/3040924799_960113373_1562076290.mp4'
file 'file:/home/drake/CalculusVisualizerProject/calc-visualizer/calc-frontend/src/Animations/media/videos/limitsAnimation/1080p60/partial_movie_files/Limit/3040924799_667144672_3149261676.mp4'
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading