| 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:
`profile_name` :: string
name of the `Profile` to use to set up the delegator with
`target` = None
target of the newly created delegator
Returns newly created delegator :: Delegator
Raises:
- `ValueError` when no profile with name `profile_name` exists
|
|
other :: Vector
|
|
other :: number
|
other :: Vector
|
other :: number
|
|
|
other :: Vector
|
other :: number
|
Constructs a 2D Vector
Overloaded, parameters:
:a:
x :: float | int = 0
y :: float | int = 0
:b:
storage :: object(x, y)
an object that provides storage for the x and y values
|
Iterates over its x and y value
|
|
other :: number
|
|
other :: Vector
|
|
other :: number
|
other :: number
|
other :: number
|
other :: number
|
|
str(x)
|
|
other :: number
|
Add a new delegator factory `Profile` to the factory.
Parameters:
`name` :: string
name of the profile
`profile` :: Profile
the profile to add
|
Assigns the values of another vector to this vector v :: Vector -- the other vector
|
Returns shallow copy :: Vector
|
|
Get the dot product of this vector with `other`
Parameters:
`other` :: Vector
the other vector
Returns :: float | int
|
Move vector by (x, y)
Parameters:
`x` :: float | int
x position
`y` :: float | int
y position
|
Set x, y coords
Parameters:
`x` :: float | int
x position
`y` :: float | int
y position
|
Normalize vector Returns :: Vector
|
Get a normalized copy of this vector Returns :: Vector
|
|
|
|||
_delegator_factory
|
|
|||
length
Read-write, length of vector
Returns :: float | int
Set parameters:
value :: number
new length
|
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 Mon Jul 19 11:49:30 2010 | http://epydoc.sourceforge.net |