Manim 中的图形绘制不平滑(math.sqrt(1-x**2))

问题描述 投票:0回答:1

当我绘制 math.sqrt(1-x**2) 的图形时,图形中有不自然的凹凸。我该如何解决?我对 Manim 很陌生。

这是我的代码:

from manim import *
import math

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

    axes = Axes(x_range=[-2.2, 2.2],
                y_range=[-1.1, 1.1]
    )
    axes.add_coordinates()

    self.play(Write(axes))
    self.wait(1)

    graph = axes.plot(lambda x: math.sqrt(1-x**2),
                      x_range=[-1, 1],
                      color = RED,
                      )

    self.play(Write(graph), run_time = 5)
    self.wait(5)

这是我得到的图表:

Graph of math.sqrt(1-x**2)

plot graph coordinates square-root manim
1个回答
0
投票

我也有同样的问题。对于您的 x 范围,尝试输入另一个数字来指示近似的步长:

x_range=[-1,1,0.01]

© www.soinside.com 2019 - 2024. All rights reserved.