code: def t2T(self, seg, t):
          
          self._calc_lengths()
          # Accept an index or a segment for seg
          if isinstance(seg, int):
              seg_idx = seg
          else:
              try:
                  seg_idx = self.index(seg)
              except ValueError:
                  assert is_path_segment(seg) or isinstance(seg, int)
                  raise
  
          segment_start = sum(self._lengths[:seg_idx])
          segment_end = segment_start + self._lengths[seg_idx]
          T = (segment_end - segment_start)*t + segment_start
          return T
docs: returns the path parameter T which corresponds to the segment
          parameter t.  In other words, for any Path object, path, and any
          segment in path, seg,  T(t) = path.t2T(seg, t) is the unique
          reparameterization such that path.point(T(t)) == seg.point(t) for all
          0 <= t <= 1.
          Input Note: seg can be a segment in the Path object or its
          corresponding index.