MCPcopy
hub / github.com/3b1b/manim / apply_function

Method apply_function

manimlib/mobject/mobject.py:986–994  ·  view source on GitHub ↗
(self, function: Callable[[np.ndarray], np.ndarray], **kwargs)

Source from the content-addressed store, hash-verified

984 return self.rotate(TAU / 2, axis, **kwargs)
985
986 def apply_function(self, function: Callable[[np.ndarray], np.ndarray], **kwargs) -> Self:
987 # Default to applying matrix about the origin, not mobjects center
988 if len(kwargs) == 0:
989 kwargs["about_point"] = ORIGIN
990 self.apply_points_function(
991 lambda points: np.array([function(p) for p in points]),
992 **kwargs
993 )
994 return self
995
996 def apply_function_to_position(self, function: Callable[[np.ndarray], np.ndarray]) -> Self:
997 self.move_to(function(self.get_center()))

Callers 6

constructMethod · 0.45
__init__Method · 0.45
apply_nudgeFunction · 0.45
interpolate_mobjectMethod · 0.45

Calls 1

apply_points_functionMethod · 0.95

Tested by

no test coverage detected