@staticmethod
def seg_project_point(seg_vec, seg_out_xy, pt):
    """
        Return parameter t of the projection to the segment.
        :param pt: numpy [X,Y]
        :return: t
        """
    Dxy = seg_vec
    AX = pt - seg_out_xy
    dxy2 = Dxy.dot(Dxy)
    assert dxy2 != 0.0
    t = AX.dot(Dxy) / dxy2
    return min(max(t, 0.0), 1.0)
