MCPcopy Index your code
hub / github.com/python/cpython / _rotate

Method _rotate

Lib/turtle.py:3380–3396  ·  view source on GitHub ↗

Turns pen clockwise by angle.

(self, angle)

Source from the content-addressed store, hash-verified

3378 self._update() #count=True)
3379
3380 def _rotate(self, angle):
3381 """Turns pen clockwise by angle.
3382 """
3383 if self.undobuffer:
3384 self.undobuffer.push(("rot", angle, self._degreesPerAU))
3385 angle *= self._degreesPerAU
3386 neworient = self._orient.rotate(angle)
3387 tracing = self.screen._tracing
3388 if tracing == 1 and self._speed > 0:
3389 anglevel = 3.0 * self._speed
3390 steps = 1 + int(abs(angle)/anglevel)
3391 delta = 1.0*angle/steps
3392 for _ in range(steps):
3393 self._orient = self._orient.rotate(delta)
3394 self._update()
3395 self._orient = neworient
3396 self._update()
3397
3398 def _newLine(self, usePos=True):
3399 """Closes current line item and starts a new one.

Callers 1

_undoMethod · 0.95

Calls 4

_updateMethod · 0.95
absFunction · 0.85
pushMethod · 0.45
rotateMethod · 0.45

Tested by

no test coverage detected