Class pymunk.vec2d

    ??._CData --+    
                |    
_ctypes.Structure --+
                    |
                   vec2d
2d vector class, supports vector and scalar operators, and also provides a bunch of high level functions

Methods

  __abs__(self)
  __add__(self, other)
  __and__(self, other)
  __div__(self, other)
  __divmod__(self, other)
  __eq__(self, other)
  __floordiv__(self, other)
  __getitem__(self, key)
  __getstate__(self)
  __iadd__(self, other)
  __idiv__(self, other)
  __ifloordiv__(self, other)
  __imul__(self, other)
  __init__(self, x_or_pair, y=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __invert__(self)
  __isub__(self, other)
  __itruediv__(self, other)
  __len__(self)
  __lshift__(self, other)
  __mod__(self, other)
  __mul__(self, other)
  __ne__(self, other)
  __neg__(self)
  __newobj__(cls, *args)
  __nonzero__(self)
  __or__(self, other)
  __pos__(self)
  __pow__(self, other)
  __radd__(self, other)
  __rand__(self, other)
  __rdiv__(self, other)
  __rdivmod__(self, other)
  __repr__(self)
  __rfloordiv__(self, other)
  __rlshift__(self, other)
  __rmod__(self, other)
  __rmul__(self, other)
  __ror__(self, other)
  __rpow__(self, other)
  __rrshift__(self, other)
  __rshift__(self, other)
  __rsub__(self, other)
  __rtruediv__(self, other)
  __rxor__(self, other)
  __setitem__(self, key, value)
  __setstate__(self, dict)
  __sub__(self, other)
  __truediv__(self, other)
  __xor__(self, other)
  convert_to_basis(self, x_vector, y_vector)
  cpvrotate(self, other)
  cpvunrotate(self, other)
  cross(self, other)
  dot(self, other)
  get_angle(self)
  get_angle_between(self, other)
  get_dist_sqrd(self, other)
  get_distance(self, other)
  get_length(self)
  get_length_sqrd(self)
  interpolate_to(self, other, range)
  normalize_return_length(self)
  normalized(self)
  perpendicular(self)
  perpendicular_normal(self)
  projection(self, other)
  rotate(self, angle_degrees)
  rotated(self, angle_degrees)
Inherited from _ctypes.Structure: __new__ Inherited from unreachable._CData: __ctypes_from_outparam__, __hash__

Properties

  angle
gets or sets the angle of a vector
  length
gets or sets the magnitude of the vector
Inherited from unreachable._CData: _b_base_, _b_needsfree_

Class Variables

  _fields_ = [('x', <class 'ctypes.c_float'>), ('y', <class 'cty...
  x = <Field type=c_float, ofs=0, size=4>
  y = <Field type=c_float, ofs=4, size=4>

Method Details

__init__

(Constructor) __init__(self, x_or_pair, y=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides:
_ctypes.Structure.__init__

Property Details

angle

gets or sets the angle of a vector

length

gets or sets the magnitude of the vector

Class Variable Details

_fields_

Value:
[('x', <class 'ctypes.c_float'>), ('y', <class 'ctypes.c_float'>)]