MCPcopy
hub / github.com/ManimCommunity/manim / shift

Method shift

manim/mobject/mobject.py:1242–1265  ·  view source on GitHub ↗

Shift by the given vectors. Parameters ---------- vectors Vectors to shift by. If multiple vectors are given, they are added together. Returns ------- :class:`Mobject` ``self`` See also --------

(self, *vectors: Vector3DLike)

Source from the content-addressed store, hash-verified

1240 func(mob)
1241
1242 def shift(self, *vectors: Vector3DLike) -> Self:
1243 """Shift by the given vectors.
1244
1245 Parameters
1246 ----------
1247 vectors
1248 Vectors to shift by. If multiple vectors are given, they are added
1249 together.
1250
1251 Returns
1252 -------
1253 :class:`Mobject`
1254 ``self``
1255
1256 See also
1257 --------
1258 :meth:`move_to`
1259 """
1260 total_vector = reduce(op.add, vectors)
1261 for mob in self.family_members_with_points():
1262 mob.points = mob.points.astype("float")
1263 mob.points += total_vector
1264
1265 return self
1266
1267 def scale(
1268 self,

Callers 15

centerMethod · 0.95
align_on_borderMethod · 0.95
next_toMethod · 0.95
set_coordMethod · 0.95
move_toMethod · 0.95
replaceMethod · 0.95
put_start_and_end_onMethod · 0.95
constructMethod · 0.45
constructMethod · 0.45
constructMethod · 0.45
constructMethod · 0.45
constructMethod · 0.45

Calls 1

Tested by 15

test_shift_familyFunction · 0.36
test_point_to_coordsFunction · 0.36
test_chained_animateFunction · 0.36
__init__Method · 0.36
test_shift_familyFunction · 0.36
test_point_to_coordsFunction · 0.36