Package pyvision :: Package types :: Module Point :: Class Point
[hide private]
[frames] | no frames]

Class Point

source code

Instance Methods [hide private]
 
__init__(self, x=0.0, y=0.0, z=0.0, w=1.0, scale=1.0, rotation=0.0)
Create a point.
source code
 
X(self)
Return the x coordiante.
source code
 
Y(self)
Return the y coordinate.
source code
 
Z(self)
Return the z coordinate.
source code
 
asArray(self, homogenious=False)
returns the point data as a 4 element numpy array.
source code
 
asVector2H(self)
Return a 2D homogenious vector [x,y,w]
source code
 
asVector3H(self)
Return a 3D homogenious vector [x,y,z,w]
source code
 
asOpenCV(self)
Return as a point compatible with OpenCV
source code
 
asTuple(self)
Return as a 2 tuple.
source code
 
asArray3D(self)
Return as an array of three elements.
source code
 
asSpherical(self)
Computes and returns a representation of this point in spherical coordinates: (r,phi,theta).
source code
 
l2(self, point)
Compute the Euclidian distance between two points.
source code
 
unit(self)
Returns a vector in the same direction but of unit length.
source code
 
magnitude(self)
Compute the magnitude of the point (distance from origin).
source code
 
__sub__(self, point)
Subtract two points
source code
 
__add__(self, point)
Add two points.
source code
 
__mul__(self, val)
Multiply the point by a value.
source code
 
__rmul__(self, val)
Multiply the point by a value.
source code
 
__str__(self)
Return a string representing the point.
source code
 
__repr__(self)
Return a string representing the point.
source code
Method Details [hide private]

__init__(self, x=0.0, y=0.0, z=0.0, w=1.0, scale=1.0, rotation=0.0)
(Constructor)

source code 

Create a point.

Arguments: x: x coordinate y: y coordinate z: z coordinate w: homoginious coordinate scale: scale selection rotation: rotation selection

asArray(self, homogenious=False)

source code 

returns the point data as a 4 element numpy array.

if 'homogenious' == True: returns x,y,z,w else: return x,y,z,1.0

asSpherical(self)

source code 

Computes and returns a representation of this point in spherical coordinates: (r,phi,theta).

r = radius or distance of the point from the origin. phi = is the angle of the projection on the xy plain and the x axis theta = is the angle with the z axis.

x = r*cos(phi)*sin(theta) y = r*sin(phi)*sin(theta) z = r*cos(theta)