Vector2 - 2-dimensional vector.
Operator and index functionality requires __pragma__ ('opov').
|
__init__(self,
*args,
**kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature |
|
|
|
|
|
|
|
|
|
|
|
|
|
__setitem__(self,
index,
val) |
|
|
|
|
|
__getslice__(self,
start,
stop) |
|
|
|
__setslice__(self,
lower,
upper,
val) |
|
|
|
|
|
|
|
|
|
|
|
dot(self,
vector)
Return dot product with other vector. |
|
|
|
cross(self,
vector)
Return cross product with other vector. |
|
|
|
magnitude(self)
Return magnitude of vector. |
|
|
|
magnitude_squared(self)
Return squared magnitude of vector. |
|
|
|
length(self)
Return length of vector. |
|
|
|
length_squared(self)
Return squared length of vector. |
|
|
|
normalize(self)
Return normalized vector. |
|
|
|
normalize_ip(self)
Normalized this vector. |
|
|
|
is_normalized(self)
Check whether vector is normalized. |
|
|
|
scale_to_length(self,
length)
Scale vector to length. |
|
|
|
reflect(self,
vector)
Return reflected vector at given vector. |
|
|
|
reflect_ip(self,
vector)
Derive reflected vector at given vector in place. |
|
|
|
distance_to(self,
vector)
Return distance to given vector. |
|
|
|
distance_squared_to(self,
vector)
Return squared distance to given vector. |
|
|
|
lerp(self,
vector,
t)
Return vector linear interpolated by t to the given vector. |
|
|
|
slerp(self,
vector,
t)
Return vector spherical interpolated by t to the given vector. |
|
|
|
elementwise(self)
Elementwice operation. |
|
|
|
rotate(self,
angle)
Return vector rotated by angle in degrees. |
|
|
|
rotate_rad(self,
angle)
Return vector rotated by angle in radians. |
|
|
|
rotate_ip(self,
angle)
Rotate vector by angle in degrees. |
|
|
|
rotate_ip_rad(self,
angle)
Rotate vector by angle in radians. |
|
|
|
angle_to(self,
vector)
Return angle to given vector. |
|
|
|
as_polar(self)
Return radial distance and azimuthal angle. |
|
|
|
from_polar(self,
coordinate)
Set vector with polar coordinate tuple. |
|
|
|
update(self,
*args,
**kwargs)
Update vector. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__floordiv__(self,
other) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__rtruediv__(self,
other) |
|
|
|
__rfloordiv__(self,
other) |
|
|
|
|
|
|
|
|
|
|
|
__itruediv__(self,
other) |
|
|
|
__ifloordiv__(self,
other) |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|