Package libavg :: Module avg :: Class Point2D

Class Point2D


A point in 2D space. Supports arithmetic operations on vectors.

Instance Methods
 
__add__(...)
 
__div__(...)
 
__eq__(...)
 
__getitem__(...)
 
__hash__(...)
hash(x)
 
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__len__(...)
 
__mul__(...)
 
__ne__(...)
 
__neg__(...)
 
__repr__(...)
repr(x)
 
__rmul__(...)
 
__setitem__(...)
 
__str__(...)
str(x)
 
__sub__(...)
norm
getNorm()
Returns the euclidian norm of the point, that is sqrt(x*x+y*y).
normalized
getNormalized()
Returns a normalized version of the point with the same angle but a norm of one.
pos
getRotated(angle)
Return the position of point rotated around the origin.
 
isInf(...)
 
isNaN(...)

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __getattribute__, __reduce__, __reduce_ex__, __setattr__

Static Methods
DPoint
fromPolar(angle, radius)
Converts polar to cartesian coordinates.
Properties
  x
  y

Inherited from object: __class__

Method Details

__hash__(...)
(Hashing function)

 

hash(x)

Overrides: object.__hash__
(inherited documentation)

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__repr__(...)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(...)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

fromPolar(angle, radius)
Static Method

 

Converts polar to cartesian coordinates. angle is in radians with 0 being the positive x axis. Assuming that y points downward, angle is clockwise.

Returns: DPoint

getRotated(angle)

 

Return the position of point rotated around the origin.

getRotated(angle, pivot) -> pos Return the position of point rotated around pivot.

Returns: pos

Property Details

x

Get Method:
unreachable(...)
Set Method:
unreachable(...)

y

Get Method:
unreachable(...)
Set Method:
unreachable(...)