import math


def unit_cell_volume(cell_a, cell_b, cell_c, cell_alpha, cell_beta, cell_gamma):
    """From the unit cell constants, compute the volume of the unit cell in
    A^3. Note that it is assumed that the cell_alpha, cell_beta, cell_gamma,
    angles are in degrees and the cell lengths (a, b, c) are in A."""

    # convert angles to radians from degrees

    pi = 4.0 * math.atan(1.0)
    dtor = pi / 180.0

    # then compute the required sines and cosines

    ca = math.cos(dtor * cell_alpha)
    cb = math.cos(dtor * cell_beta)
    cc = math.cos(dtor * cell_gamma)

    # finally evaluate the volume - this is simply the volume of a
    # parallelopiped

    V = (
        cell_a
        * cell_b
        * cell_c
        * math.sqrt(1 - ca * ca - cb * cb - cc * cc + 2 * ca * cb * cc)
    )
    return V