def mat311mod(a, b):
    """
    Compute moduli of a 3x1 matrix.
    
    Parameters
    ----------
    a : tuple of float
		3x1 matrix
	b : float
		modulus
		
	Returns
	-------
	res : tuple of float
		3x1 matrix
    """
    res = [0, 0, 0]
    r3 = range(3)
    for i in r3:
        res[i] = int(a[i] - int(a[i]/b)*b)
    return res