<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def polymer_to_reference_axis_distances(p, reference_axis, tag=True, reference_axis_name='ref_axis'):
 """Returns distances between the primitive of a Polymer and a reference_axis. Notes ----- Distances are calculated between each point of the Polymer primitive and the corresponding point in reference_axis. In the special case of the helical barrel, if the Polymer is a helix and the reference_axis represents the centre of the barrel, then this function returns the radius of the barrel at each point on the helix primitive. The points of the primitive and the reference_axis are run through in the same order, so take care with the relative orientation of the reference axis when defining it. Parameters p : ampal.Polymer reference_axis : list(numpy.array or tuple or list) Length of reference_axis must equal length of the Polymer. Each element of reference_axis represents a point in R^3. tag : bool, optional If True, tags the Chain with the reference axis coordinates and each Residue with its distance to the ref axis. Distances are stored at the Residue level, but refer to distances from the CA atom. reference_axis_name : str, optional Used to name the keys in tags at Chain and Residue level. Returns ------- distances : list(float) Distance values between corresponding points on the reference axis and the `Polymer` `Primitive`. Raises ------ ValueError If the Polymer and the reference_axis have unequal length. """

    if not len(p) == len(reference_axis):
        raise ValueError(
            "The reference axis must contain the same number of points "
            "as the Polymer primitive.")
    prim_cas = p.primitive.coordinates
    ref_points = reference_axis.coordinates
    distances = [distance(prim_cas[i], ref_points[i])
                 for i in range(len(prim_cas))]
    if tag:
        p.tags[reference_axis_name] = reference_axis
        monomer_tag_name = 'distance_to_{0}'.format(reference_axis_name)
        for m, d in zip(p._monomers, distances):
            m.tags[monomer_tag_name] = d
    return distances