How to get a more precise graph?
- Vorherrschende Sprache
- Python
- Sterne
- 93.8k
- Forks
- 7.7k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Hi,
I'm doing this project about lacunary fonction.
I'm having a problem to represent this fuction : $F(x) = \\sum_{n=1}^N \\frac{1}{n!}{\\exp^{n!x}}$
in this code:
`
class lacunary(GraphScene,MovingCameraScene):
CONFIG = {
"x_min": -1,
"x_max": 1,
"x_axis_width": 50,
"x_tick_frequency": 1,
"x_leftmost_tick": None, # Change if different from x_min
"x_labeled_nums": None,
"x_axis_label": "$x$",
"y_min": -3,
"y_max": 3,
"y_axis_height": 6,
"y_tick_frequency": 1,
"y_bottom_tick": None, # Change if different from y_min
"y_labeled_nums": None,
"y_axis_label": "$y$",
"axes_color": GREY,
"graph_origin": ORIGIN,
"exclude_zero_label": True,
"default_graph_colors": [BLUE, GREEN, YELLOW],
"default_derivative_color": GREEN,
"default_input_color": YELLOW,
"default_riemann_start_color": BLUE,
"default_riemann_end_color": GREEN,
"area_opacity": 0.8,
"num_rects": 50,
}
# Setup the scenes
def setup(self):
GraphScene.setup(self)
MovingCameraScene.setup(self)
def construct(self):
self.setup_axes(animate=False)
def F(x):
sum=0
for n in range(12):
sum= sum + np.cos(x*np.math.factorial(n))*1/np.math.factorial(n)
return sum
path = ParametricFunction(
lambda t: [t,F(t),0],
t_min=-3,
t_max=3,
color=GREEN,
step_size=0.01,
dt=1e-8,
)
self.add(path)
self.wait(3)
self.play(
self.camera_frame.scale,0.01,
self.camera_frame.move_to,UP+RIGHT
)
self.wait(2)
self.wait()
`
When N is too high the graph doesn't show the very small oscillations.
I'd like to be able to zoom in like in a fractal, but I'm not sure I can do it.
If anyone can help me that would be great.
THANKS
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.