| Trees | Indices | Toggle frames |
|---|
??._CData --+
|
_ctypes.Structure --+
|
Vec2d
2d vector class, supports vector and scalar operators,
and also provides a bunch of high level functions
|
from_param(cls,
arg)
Used by ctypes to automatically create Vec2ds
|
|
|
__init__(self,
x_or_pair,
y=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
|
|
| __len__(self) | |
| __getitem__(self, key) | |
| __setitem__(self, key, value) | |
| __repr__(self) | |
| __eq__(self, other) | |
| __ne__(self, other) | |
| __nonzero__(self) | |
| __add__(self, other) | |
| __radd__(self, other) | |
| __iadd__(self, other) | |
| __sub__(self, other) | |
| __rsub__(self, other) | |
| __isub__(self, other) | |
| __mul__(self, other) | |
| __rmul__(self, other) | |
| __imul__(self, other) | |
| __div__(self, other) | |
| __rdiv__(self, other) | |
| __idiv__(self, other) | |
| __floordiv__(self, other) | |
| __rfloordiv__(self, other) | |
| __ifloordiv__(self, other) | |
| __truediv__(self, other) | |
| __rtruediv__(self, other) | |
| __itruediv__(self, other) | |
| __mod__(self, other) | |
| __rmod__(self, other) | |
| __divmod__(self, other) | |
| __rdivmod__(self, other) | |
| __pow__(self, other) | |
| __rpow__(self, other) | |
| __lshift__(self, other) | |
| __rlshift__(self, other) | |
| __rshift__(self, other) | |
| __rrshift__(self, other) | |
| __and__(self, other) | |
| __rand__(self, other) | |
| __or__(self, other) | |
| __ror__(self, other) | |
| __xor__(self, other) | |
| __rxor__(self, other) | |
| __neg__(self) | |
| __pos__(self) | |
| __abs__(self) | |
| __invert__(self) | |
|
get_length_sqrd(self)
Get the squared length of the vector.
|
|
|
get_length(self)
Get the length of the vector.
|
|
|
rotate(self,
angle_degrees)
Rotate the vector by angle_degrees degrees.
|
|
|
rotated(self,
angle_degrees)
Create and return a new vector by rotating this vector by
angle_degrees degrees.
|
|
| get_angle(self) | |
|
get_angle_between(self,
other)
Get the angle between the vector and the other in degrees
|
|
|
normalized(self)
Get a normalized copy of the vector
|
|
|
normalize_return_length(self)
Normalize the vector and return its length before the normalization
|
|
| perpendicular(self) | |
| perpendicular_normal(self) | |
|
dot(self,
other)
v1.dot(v2) -> v1.x*v2.x + v1.y*v2.y
|
|
|
get_distance(self,
other)
The distance between the vector and other vector
|
|
|
get_dist_sqrd(self,
other)
The squared distance between the vector and other vector
It is more efficent to use this method than to call get_distance()
first and then do a sqrt() on the result.
|
|
| projection(self, other) | |
|
cross(self,
other)
v1.cross(v2) -> v1.x*v2.y - v2.y-v1.x
|
|
| interpolate_to(self, other, range) | |
| convert_to_basis(self, x_vector, y_vector) | |
| cpvrotate(self, other) | |
| cpvunrotate(self, other) | |
| __getstate__(self) | |
| __setstate__(self, dict) | |
| __newobj__(cls, *args) | |
Inherited from _ctypes.Structure:
__new__
Inherited from unreachable._CData:
__ctypes_from_outparam__,
__hash__
|
|
|
length
Gets or sets the magnitude of the vector
|
|
|
angle
Gets or sets the angle of a vector
|
|
Inherited from unreachable._CData:
_b_base_,
_b_needsfree_
|
|
_fields_ =
|
|
x = <Field type=c_float, ofs=0, size=4>
|
|
y = <Field type=c_float, ofs=4, size=4>
|
|
| Trees | Indices | Toggle frames |
|---|
| Generated by Epydoc 3.0beta1 on Sun Jun 15 16:45:17 2008 | http://epydoc.sourceforge.net |