| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
Vector
2D Point/Vector
Class fields:
- `INFINITY`: immutable Vector of positive infinity
- `NULL`: immutable Vector (0, 0)
Instance methods:
- `move_to`: Set x, y position
- `move_by`: Move vector by x, y
- `assign`: Assign values of other vector to this one
- `copy`: Shallow copy
- `normalize`: Normalize vector
- `normalized`: Get a normalized copy of this vector
- `dot`: Dot product
- `cross`:
- `reflect`:
Instance properties:
- `x`: Read-write, x position
- `y`: Read-write, y position
- `length`: Read-write, length of vector
- `length_squared`: Read-only, length squared
Operators:
str(s)
s == v
s != v
s + v
s += v
s - v
s -= v
s * n
s *= n
s / n
s /= n
-s
self explanatory
len(s)
returns 2
iter(s)
iterates over its x and y value
abs(s)
returns length of vector
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
|||
|
|||
INFINITY = ImmutableVector(Vector(float("inf"), float("inf")))
|
|||
NULL = ImmutableVector(Vector(0, 0))
|
|||
_delegator_factory = <pytilities.delegation.delegatorfactory.D
|
|||
|
|||
|
length Read-write, length of vector |
|||
|
length_squared Read-only, length squared :: float | int |
|||
|
x Read-write, x position ::float | int |
|||
|
y Read-write, y position ::float | int |
|||
|
Inherited from |
|||
|
|||
Construct a delegator with a stored Profile. Parameters:
Returns newly created delegator :: Delegator Raises:
|
|
|
|
|
|
|
|
|
|
|
Constructs a 2D Vector Overloaded, parameters:
|
|
|
|
|
|
|
|
|
|
|
|
str(x)
|
|
|
Assigns the values of another vector to this vector v :: Vector -- the other vector
|
|
|
Get the dot product of this vector with Parameters:
Returns :: float | int
|
Move vector by (x, y) Parameters:
|
Set x, y coords Parameters:
|
Normalize vector Returns :: Vector
|
Get a normalized copy of this vector Returns :: Vector
|
|
|
|||
_delegator_factory
|
|
|||
lengthRead-write, length of vector Returns :: float | int Set parameters:
|
length_squaredRead-only, length squared :: float | int
|
xRead-write, x position ::float | int
|
yRead-write, y position ::float | int
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0 on Thu Jul 22 13:11:42 2010 | http://epydoc.sourceforge.net |