def normalise(vec):
    """
    Scales a vector so its magnitude is unity.

    :param vec: a vector.
    :type vec: Homogeneous
    :returns: a new vector object.
    :rtype: Homogeneous
    :requires: vec to be a vector.
    """
    m = vec.magnitude
    return vec / m
