import math


def top2daz(north, east, up):
    """Compute azimouth, zenith and distance from a topocentric vector.

        Given a topocentric vector (aka north, east and up components), compute
        the azimouth, zenith angle and distance between the two points.

        Args:
            north (float): the north component (in meters)
            east (float) : the east component (in meters)
            up (float)   : the up component (in meters)

        Returns:
            tuple (floats): a tuple of three floats is returned, as:
                            [distance, azimouth, zenith], where distance is
                            in meters, and azimouth and zenith are in radians.
    """
    distance = math.sqrt(north*north + east*east + up*up)
    a        = math.atan2(east, north) % (math.pi*2e0) # normalized [0, 2pi]
    zenith   = math.acos(up/distance);
    return distance, a, zenith