Module vec2d :: Class Vec2d
[hide private]
[frames] | no frames]

Class Vec2d

source code


2d vector class, supports vector and scalar operators, and also provides a bunch of high level functions

Instance Methods [hide private]
 
__init__(self, x_or_pair, y=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__len__(self) source code
 
__getitem__(self, key) source code
 
__setitem__(self, key, value) source code
 
__repr__(self)
repr(x)
source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
__nonzero__(self) source code
 
_o2(self, other, f)
Any two-operator operation where the left operand is a Vec2d
source code
 
_r_o2(self, other, f)
Any two-operator operation where the right operand is a Vec2d
source code
 
_io(self, other, f)
inplace operator
source code
 
__add__(self, other) source code
 
__radd__(self, other) source code
 
__iadd__(self, other) source code
 
__sub__(self, other) source code
 
__rsub__(self, other) source code
 
__isub__(self, other) source code
 
__mul__(self, other) source code
 
__rmul__(self, other) source code
 
__imul__(self, other) source code
 
__div__(self, other) source code
 
__rdiv__(self, other) source code
 
__idiv__(self, other) source code
 
__floordiv__(self, other) source code
 
__rfloordiv__(self, other) source code
 
__ifloordiv__(self, other) source code
 
__truediv__(self, other) source code
 
__rtruediv__(self, other) source code
 
__itruediv__(self, other) source code
 
__mod__(self, other) source code
 
__rmod__(self, other) source code
 
__divmod__(self, other) source code
 
__rdivmod__(self, other) source code
 
__pow__(self, other) source code
 
__rpow__(self, other) source code
 
__lshift__(self, other) source code
 
__rlshift__(self, other) source code
 
__rshift__(self, other) source code
 
__rrshift__(self, other) source code
 
__and__(self, other) source code
 
__rand__(self, other) source code
 
__or__(self, other) source code
 
__ror__(self, other) source code
 
__xor__(self, other) source code
 
__rxor__(self, other) source code
 
__neg__(self) source code
 
__pos__(self) source code
 
__abs__(self) source code
 
__invert__(self) source code
 
get_length_sqrd(self) source code
 
get_length(self) source code
 
__setlength(self, value) source code
 
rotate(self, angle_degrees) source code
 
rotated(self, angle_degrees) source code
 
get_angle(self) source code
 
__setangle(self, angle_degrees) source code
 
get_angle_between(self, other) source code
 
normalized(self) source code
 
normalize_return_length(self) source code
 
perpendicular(self) source code
 
perpendicular_normal(self) source code
 
dot(self, other) source code
 
get_distance(self, other) source code
 
get_dist_sqrd(self, other) source code
 
projection(self, other) source code
 
cross(self, other) source code
 
interpolate_to(self, other, range) source code
 
convert_to_basis(self, x_vector, y_vector) source code
 
__getstate__(self) source code
 
__setstate__(self, dict) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]
  length
gets or sets the magnitude of the vector
  angle
gets or sets the angle of a vector
  x
  y

Inherited from object: __class__

Method Details [hide private]

__init__(self, x_or_pair, y=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

Property Details [hide private]

length

gets or sets the magnitude of the vector

Get Method:
get_length(self)
Set Method:
__setlength(self, value)

angle

gets or sets the angle of a vector

Get Method:
get_angle(self)
Set Method:
__setangle(self, angle_degrees)