隐函数¶
限定名称: manim.mobject.graphing.functions.ImplicitFunction
- class ImplicitFunction(func, x_range=None, y_range=None, min_depth=5, max_quads=1500, use_smoothing=True, **kwargs)[source]¶
基础类:
VMobject一个隐式函数。
- Parameters:
func (Callable[[float, float], float]) – 隐式函数的形式为
f(x, y) = 0。x_range (Sequence[float] | None) – 函数的x最小值和最大值。
y_range (Sequence[float] | None) – 函数的y最小值和最大值。
min_depth (int) – 要计算的函数的最小深度。
max_quads (int) – 使用的最大四边形数量。
use_smoothing (bool) – 是否平滑曲线。
kwargs – 传递给
VMobject的额外参数
注意
一个小的
min_depth\(d\) 意味着如果某些小细节没有跨越其中一个\(4^d\) 均匀四边形的边缘,它们可能会被忽略。max_quads的值与曲线的质量密切相关,但更多的四边形可能会导致渲染时间变长。示例
示例:ImplicitFunctionExample ¶
from manim import * class ImplicitFunctionExample(Scene): def construct(self): graph = ImplicitFunction( lambda x, y: x * y ** 2 - x ** 2 * y - 2, color=YELLOW ) self.add(NumberPlane(), graph)
class ImplicitFunctionExample(Scene): def construct(self): graph = ImplicitFunction( lambda x, y: x * y ** 2 - x ** 2 * y - 2, color=YELLOW ) self.add(NumberPlane(), graph)方法
初始化
points并因此确定形状。初始化
points并因此确定形状。属性
animate用于动画化
self的任何方法的应用。animation_overridescolordepthmobject的深度。
fill_color如果有多种颜色(用于渐变),则返回第一个颜色
heightmobject的高度。
n_points_per_curvesheen_factorstroke_colorwidthmobject的宽度。
- _original__init__(func, x_range=None, y_range=None, min_depth=5, max_quads=1500, use_smoothing=True, **kwargs)¶
一个隐式函数。
- Parameters:
func (Callable[[float, float], float]) – 隐式函数的形式为
f(x, y) = 0。x_range (Sequence[float] | None) – 函数的x最小值和最大值。
y_range (Sequence[float] | None) – 函数的y最小值和最大值。
min_depth (int) – 要计算的函数的最小深度。
max_quads (int) – 使用的最大四边形数量。
use_smoothing (bool) – 是否平滑曲线。
kwargs – 传递给
VMobject的额外参数
注意
一个小的
min_depth\(d\) 意味着如果某些小细节没有跨越其中一个 \(4^d\) 均匀四边形的边缘,它们可能会被忽略。max_quads的值与曲线的质量密切相关,但更多的四边形可能会导致渲染时间更长。示例
示例:ImplicitFunctionExample ¶
from manim import * class ImplicitFunctionExample(Scene): def construct(self): graph = ImplicitFunction( lambda x, y: x * y ** 2 - x ** 2 * y - 2, color=YELLOW ) self.add(NumberPlane(), graph)
class ImplicitFunctionExample(Scene): def construct(self): graph = ImplicitFunction( lambda x, y: x * y ** 2 - x ** 2 * y - 2, color=YELLOW ) self.add(NumberPlane(), graph)
- init_points()¶
初始化
points并因此确定形状。在创建时调用。这是一个可以由子类实现的空方法。