# pointfuncs.py # Walker M. White (wmw2) # September 7, 2013 """Demonstrate the Point class This module has a few simple functions that show how to use the Point class. You should study these examples for Lab 3.""" import tuple3d def incr_x(q): """Increments the x coord of p by 1 Example: (1,2,3) becomes (2,2,3) The function does not return a value (it is a procedure). It just modifies the point "in place" Precondition: p is a Point object""" q.x = q.x+1 def copy2d(p): """Makes a 2d copy of the point p This function makes (and returns) a new point that has the same x, y value as p, but whose z value is 0. Precondition: p is a Point object""" # Make a new point q = tuple3d.Point(p.x,p.y,0) return q