def translate(curve):
    """
    P.translate(numpy.ndarray) -> numpy.ndarray
    
    Take a three dimensional curve defined by a numpy ndarray and translate
    that curve so that the mean of each of spatial componenets lies at the
    origin.
    """
    try:
        return curve - sum(curve)/curve.shape[0]
    except AttributeError:
        raise TypeError("Scale accepts only numpy arrays")