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 + b
vector addition -
a - b
vector subtraction -
a * b
inner product -
k * a
anda * k
multiplication with scalar -
abs(a)
absolute value of a -
a.rotate(angle)
rotation
Please login to continue.