Merge pull request #1757 from TurkeyBilly/patch-7

Reorganize getters for ParametricCurve
This commit is contained in:
Grant Sanderson 2022-03-06 09:27:22 -08:00 committed by GitHub
commit dfbbb34035
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,6 +48,18 @@ class ParametricCurve(VMobject):
self.set_points([self.t_func(t_min)]) self.set_points([self.t_func(t_min)])
return self return self
def get_t_func(self):
return self.t_func
def get_function(self):
if hasattr(self, "underlying_function"):
return self.underlying_function
if hasattr(self, "function"):
return self.function
def get_x_range(self):
if hasattr(self, "x_range"):
return self.x_range
class FunctionGraph(ParametricCurve): class FunctionGraph(ParametricCurve):
CONFIG = { CONFIG = {
@ -67,12 +79,6 @@ class FunctionGraph(ParametricCurve):
super().__init__(parametric_function, self.x_range, **kwargs) super().__init__(parametric_function, self.x_range, **kwargs)
def get_function(self):
return self.function
def get_point_from_function(self, x):
return self.t_func(x)
class ImplicitFunction(VMobject): class ImplicitFunction(VMobject):
CONFIG = { CONFIG = {