1 |
ksteube |
1147 |
""" |
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 |
jongui |
1189 |
self.__x_coor = x_coor |
21 |
|
|
self.__y_coor = y_coor |
22 |
ksteube |
1147 |
self.__position = [x_coor, y_coor] |
23 |
|
|
|
24 |
jongui |
1189 |
def _getXCoor(self): |
25 |
|
|
""" |
26 |
|
|
Return the X coordinate. |
27 |
|
|
|
28 |
|
|
@rtype: Number |
29 |
|
|
@return: X coordinate |
30 |
|
|
""" |
31 |
|
|
|
32 |
|
|
return self.__x_coor |
33 |
|
|
|
34 |
|
|
def _getYCoor(self): |
35 |
|
|
""" |
36 |
|
|
Return the Y coordinate. |
37 |
|
|
|
38 |
|
|
@rtype: Number |
39 |
|
|
@return: Y coordinate |
40 |
|
|
""" |
41 |
|
|
|
42 |
|
|
return self.__y_coor |
43 |
|
|
|
44 |
ksteube |
1147 |
def _getLocalPosition(self): |
45 |
|
|
""" |
46 |
|
|
Return the local position. |
47 |
|
|
|
48 |
|
|
@rtype: Two column tuple containing numbers |
49 |
|
|
@return: Tuple with the x and y coordinates |
50 |
|
|
""" |
51 |
|
|
|
52 |
|
|
return self.__position |
53 |
|
|
|
54 |
|
|
|
55 |
|
|
############################################################################### |
56 |
|
|
|
57 |
|
|
|
58 |
|
|
class GlobalPosition: |
59 |
|
|
""" |
60 |
|
|
Class that defines the global positioning coordinate system (3D) |
61 |
|
|
""" |
62 |
|
|
|
63 |
|
|
def __init__(self, x_coor, y_coor, z_coor): |
64 |
|
|
""" |
65 |
|
|
Initialise the global position. |
66 |
|
|
|
67 |
|
|
@type x_coor: Number |
68 |
|
|
@param x_coor: x coordinate |
69 |
|
|
@type y_coor: Number |
70 |
|
|
@param y_coor: y coordinate |
71 |
|
|
@type z_coor: Number |
72 |
|
|
@param z_coor: z coordinate |
73 |
|
|
""" |
74 |
|
|
|
75 |
|
|
self.__position = [x_coor, y_coor, z_coor] |
76 |
|
|
|
77 |
|
|
def _getGlobalPosition(self): |
78 |
|
|
""" |
79 |
|
|
Return the global position. |
80 |
|
|
|
81 |
|
|
@rtype: Three column tuple containing numbers |
82 |
|
|
@return: Tuple with the x, y and z coordinates |
83 |
|
|
""" |
84 |
|
|
|
85 |
|
|
return self.__position |