/[escript]/trunk/pyvisi/py_src/position.py
ViewVC logotype

Contents of /trunk/pyvisi/py_src/position.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1199 - (show annotations)
Wed Jun 20 05:01:30 2007 UTC (12 years ago) by jongui
File MIME type: text/x-python
File size: 2158 byte(s)
- Updated the epydocs and guide.
Deleted redundant files and methods.
Tidied up the codes.
1 """
2 @var __author__: name of author
3 @var __copyright__: copyrights
4 @var __license__: licence agreement
5 @var __url__: url entry point on documentation
6 @var __version__: version
7 @var __date__: date of the version
8 """
9
10 __author__="John Ngui, john.ngui@uq.edu.au"
11 __copyright__=""" Copyright (c) 2006 by ACcESS MNRF
12 http://www.access.edu.au
13 Primary Business: Queensland, Australia"""
14 __license__="""Licensed under the Open Software License version 3.0
15 http://www.opensource.org/licenses/osl-3.0.php"""
16 __url__="http://www.iservo.edu.au/esys"
17 __version__="$Revision$"
18 __date__="$Date$"
19
20
21 class LocalPosition:
22 """
23 Class that defines the local positioning (X and Y)coordiante system (2D).
24 """
25
26 def __init__(self, x_coor, y_coor):
27 """
28 Initialise the local position.
29
30 @type x_coor: Number
31 @param x_coor: x coordinate
32 @type y_coor: Number
33 @param y_coor: y coordinate
34 """
35
36 self.__x_coor = x_coor
37 self.__y_coor = y_coor
38 self.__position = [x_coor, y_coor]
39
40 def _getXCoor(self):
41 """
42 Return the X coordinate.
43
44 @rtype: Number
45 @return: X coordinate
46 """
47
48 return self.__x_coor
49
50 def _getYCoor(self):
51 """
52 Return the Y coordinate.
53
54 @rtype: Number
55 @return: Y coordinate
56 """
57
58 return self.__y_coor
59
60 def _getLocalPosition(self):
61 """
62 Return the local position.
63
64 @rtype: Two column tuple containing numbers
65 @return: Tuple with the x and y coordinates
66 """
67
68 return self.__position
69
70
71 ###############################################################################
72
73
74 class GlobalPosition:
75 """
76 Class that defines the global positioning (X, Y and Z) coordinate system
77 (3D)
78 """
79
80 def __init__(self, x_coor, y_coor, z_coor):
81 """
82 Initialise the global position.
83
84 @type x_coor: Number
85 @param x_coor: x coordinate
86 @type y_coor: Number
87 @param y_coor: y coordinate
88 @type z_coor: Number
89 @param z_coor: z coordinate
90 """
91
92 self.__position = [x_coor, y_coor, z_coor]
93
94 def _getGlobalPosition(self):
95 """
96 Return the global position.
97
98 @rtype: Three column tuple containing numbers
99 @return: Tuple with the x, y and z coordinates
100 """
101
102 return self.__position

  ViewVC Help
Powered by ViewVC 1.1.26