def curvature(self, T):
seg_idx, t = self.T2t(T)<EOL>seg = self[seg_idx]<EOL>if np.isclose(t, <NUM_LIT:0>) and (seg_idx != <NUM_LIT:0> or self.end==self.start):<EOL><INDENT>previous_seg_in_path = self._segments[<EOL>(seg_idx - <NUM_LIT:1>) % len(self._segments)]<EOL>if not seg.joins_smoothly_with(previous_seg_in_path):<EOL><INDENT>return float('<STR_LIT>')<EOL><DEDENT><DEDENT>elif np.isclose(t, <NUM_LIT:1>) and (seg_idx != len(self) - <NUM_LIT:1> or<EOL>self.end == self.start):<EOL><INDENT>next_seg_in_path = self._segments[<EOL>(seg_idx + <NUM_LIT:1>) % len(self._segments)]<EOL>if not next_seg_in_path.joins_smoothly_with(seg):<EOL><INDENT>return float('<STR_LIT>')<EOL><DEDENT><DEDENT>dz = self.derivative(T)<EOL>ddz = self.derivative(T, n=<NUM_LIT:2>)<EOL>dx, dy = dz.real, dz.imag<EOL>ddx, ddy = ddz.real, ddz.imag<EOL>return abs(dx*ddy - dy*ddx)/(dx*dx + dy*dy)**<NUM_LIT><EOL>
returns the curvature of this Path object at T and outputs
        float('inf') if not differentiable at T.