def minimise_xyz ( xyz ) : x , y , z = xyz m = max ( min ( x , y ) , min ( max ( x , y ) , z ) ) return ( x - m , y - m , z - m )
python limit x y z range
Minimise an ( x y z ) coordinate .
def minimise_xyz(xyz):
    """Minimise an (x, y, z) coordinate."""
    x, y, z = xyz
    m = max(min(x, y), min(max(x, y), z))
    return (x-m, y-m, z-m)