Salome HOME
Merge from V6_main 11/02/2013
[modules/geom.git] / doc / salome / examples / point_coordinates.py
1 # Point Coordinates
2
3 import math
4 import geompy
5
6 # create a point
7 point = geompy.MakeVertex(15., 23., 80.)
8
9 # get the coordinates of the point and check its values
10 coords = geompy.PointCoordinates(point)
11
12 # check the obtained coordinate values
13 tolerance = 1.e-07
14 def IsEqual(val1, val2): return (math.fabs(val1 - val2) < tolerance)
15
16 if IsEqual(coords[0], 15.) and IsEqual(coords[1], 23.) and IsEqual(coords[2], 80.):
17     print "All values are OK."
18 else :
19     print "Coordinates of point must be (15, 23, 80), but returned (",
20     print coords[0], ", ", coords[1], ", ", coords[2], ")"
21     pass