mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
Add an option for a graph to continually update to its defining function
This commit is contained in:
parent
cbc32468bf
commit
0d046a7eab
1 changed files with 5 additions and 0 deletions
|
@ -175,6 +175,7 @@ class CoordinateSystem(ABC):
|
||||||
self,
|
self,
|
||||||
function: Callable[[float], float],
|
function: Callable[[float], float],
|
||||||
x_range: Sequence[float] | None = None,
|
x_range: Sequence[float] | None = None,
|
||||||
|
bind: bool = False,
|
||||||
**kwargs
|
**kwargs
|
||||||
) -> ParametricCurve:
|
) -> ParametricCurve:
|
||||||
x_range = x_range or self.x_range
|
x_range = x_range or self.x_range
|
||||||
|
@ -195,6 +196,10 @@ class CoordinateSystem(ABC):
|
||||||
)
|
)
|
||||||
graph.underlying_function = function
|
graph.underlying_function = function
|
||||||
graph.x_range = x_range
|
graph.x_range = x_range
|
||||||
|
|
||||||
|
if bind:
|
||||||
|
self.bind_graph_to_func(graph, function)
|
||||||
|
|
||||||
return graph
|
return graph
|
||||||
|
|
||||||
def get_parametric_curve(
|
def get_parametric_curve(
|
||||||
|
|
Loading…
Add table
Reference in a new issue