class turtle.Vec2D(x, y)
A two-dimensional vector class, used as a helper class for implementing turtle graphics. May be useful for turtle graphics programs too. Derived from tuple, so a vector is a tuple!
Provides (for a, b vectors, k number):
-
a + bvector addition -
a - bvector subtraction -
a * binner product -
k * aanda * kmultiplication with scalar -
abs(a)absolute value of a -
a.rotate(angle)rotation
Please login to continue.