MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / rotate

Method rotate

tools/python-3.11.9-amd64/Lib/turtle.py:269–275  ·  view source on GitHub ↗

rotate self counterclockwise by angle

(self, angle)

Source from the content-addressed store, hash-verified

267 def __abs__(self):
268 return math.hypot(*self)
269 def rotate(self, angle):
270 """rotate self counterclockwise by angle
271 """
272 perp = Vec2D(-self[1], self[0])
273 angle = math.radians(angle)
274 c, s = math.cos(angle), math.sin(angle)
275 return Vec2D(self[0]*c+perp[0]*s, self[1]*c+perp[1]*s)
276 def __getnewargs__(self):
277 return (self[0], self[1])
278 def __repr__(self):

Callers 2

_rotateMethod · 0.45
_rotateMethod · 0.45

Calls 2

Vec2DClass · 0.85
radiansMethod · 0.80

Tested by

no test coverage detected