import math


def horizontal_to_cartesian(altitude, azimuth):
    """Convert a "horizontal" coordinate given in altitude and azimuth to the
    corresponding 3D cartesian location."""
    theta = math.pi / 2 - math.radians(altitude)
    phi = math.radians(-azimuth)
    x = math.sin(phi) * math.sin(-theta)
    y = math.sin(theta) * math.cos(phi)
    z = math.cos(theta)
    return x, y, z