隐式函数¶
全称: manim.mobject.graphing.functions.ImplicitFunction
- class ImplicitFunction(func, x_range=None, y_range=None, min_depth=5, max_quads=1500, use_smoothing=True, **kwargs)[来源]¶
基类:
VMobject
一个隐式函数。
- 参数:
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_overrides (动画覆盖)
颜色
depth (深度)
mobject 的深度。
fill_color (填充颜色)
如果存在多种颜色(用于渐变),则返回第一种颜色
height (高度)
mobject 的高度。
n_points_per_curve (每条曲线的点数)
sheen_factor (光泽因子)
stroke_color (描边颜色)
width (宽度)
mobject 的宽度。
- _original__init__(func, x_range=None, y_range=None, min_depth=5, max_quads=1500, use_smoothing=True, **kwargs)¶
一个隐式函数。
- 参数:
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
,从而确定形状。在创建时调用。这是一个空方法,可由子类实现。