transform 进阶
1、ApplyMethod
这个只能执行mobject的方法,例如:
s=Square()
sp(ApplyMethod(s.scale,3))
2、ApplyPointwiseFunction
s = Square() self.play(s.animate.apply_function(lambda p : p + np.array([np.sin(p[1]),np.sin(p[0]),0])))
1、ApplyMethod
这个只能执行mobject的方法,例如:
s=Square()
sp(ApplyMethod(s.scale,3))
2、ApplyPointwiseFunction
s = Square() self.play(s.animate.apply_function(lambda p : p + np.array([np.sin(p[1]),np.sin(p[0]),0])))