1 |
""" |
2 |
@author: John NGUI |
3 |
""" |
4 |
|
5 |
class LocalPosition: |
6 |
""" |
7 |
Class that defines the local positioning coordiante system (2D). |
8 |
""" |
9 |
|
10 |
def __init__(self, x_coor, y_coor): |
11 |
""" |
12 |
Initialise the local position. |
13 |
|
14 |
@type x_coor: Number |
15 |
@param x_coor: x coordinate |
16 |
@type y_coor: Number |
17 |
@param y_coor: y coordinate |
18 |
""" |
19 |
|
20 |
self.__position = [x_coor, y_coor] |
21 |
|
22 |
def _getLocalPosition(self): |
23 |
""" |
24 |
Return the local position. |
25 |
|
26 |
@rtype: Two column tuple containing numbers |
27 |
@return: Tuple with the x and y coordinates |
28 |
""" |
29 |
|
30 |
return self.__position |
31 |
|
32 |
|
33 |
############################################################################### |
34 |
|
35 |
|
36 |
class GlobalPosition: |
37 |
""" |
38 |
Class that defines the global positioning coordinate system (3D) |
39 |
""" |
40 |
|
41 |
def __init__(self, x_coor, y_coor, z_coor): |
42 |
""" |
43 |
Initialise the global position. |
44 |
|
45 |
@type x_coor: Number |
46 |
@param x_coor: x coordinate |
47 |
@type y_coor: Number |
48 |
@param y_coor: y coordinate |
49 |
@type z_coor: Number |
50 |
@param z_coor: z coordinate |
51 |
""" |
52 |
|
53 |
self.__position = [x_coor, y_coor, z_coor] |
54 |
|
55 |
def _getGlobalPosition(self): |
56 |
""" |
57 |
Return the global position. |
58 |
|
59 |
@rtype: Three column tuple containing numbers |
60 |
@return: Tuple with the x, y and z coordinates |
61 |
""" |
62 |
|
63 |
return self.__position |