vector
¶
vector
module contains Vector
class used to represent 2D coordinates.
Vector
¶
Bases: ModelType
Represents a point in cartesian coordinate space.
from_tuple
classmethod
¶
Create a new point from a tuple.
angle_between
¶
Calculate clockwise angle between two vectors in degrees.
Value returned is always between 0 and 360 (can be 0, never 360).
self is the starting vector, other is the ending vector.
from math import * s = Vector(x=sin(pi / 4) * 1, y=-sin(pi / 4) * 1) e = Vector(x=-sin(pi / 4) * 1, y=-sin(pi / 4) * 1) s.angle_between(e) 90.0 e.angle_between(s) 270.0
angle_between_cc
¶
Calculate counter clockwise angle between two vectors in degrees.
Value returned is always between 0 and 360 (can be 0, never 360).