3b1b / 3b1b/manim

How to get a more precise graph?

Aberta
#1,001 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
93.9k
Forks
7.7k
Merge médio
2d 13h
PRs com merge (30d)
4

Descrição

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

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Este issue é sobre precisão de renderização na GraphScene do manim. Observe os parâmetros step_size e dt do ParametricFunction e o escalonamento da câmera. Comece examinando o código-fonte do manim para GraphScene e ParametricFunction para entender como o sampling funciona. Teste com valores menores de step_size e veja se as oscilações ficam visíveis quando o zoom é aplicado. 'Done' significa que o gráfico mostra oscilações finas em alto N quando a câmera faz zoom.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Domínio
computer-graphics, data-visualization
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
45/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.