<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">"""
Module to demonstrate the Point class

This module has a few simple functions that show how to use the Point class in
Cornell Extensions.

Author: Walker M. White (wmw2)
Date:   September 16, 2017 (Python 3 Version)
"""
import introcs


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"
    
    Parameter p: The point to adjust
    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.
    
    Parameter p: The point to copy
    Precondition: p is a Point object
    """
    # Make a new point
    q = introcs.Point3(p.x,p.y,0)
    return q
</pre></body></html>