def segment_curvature(self, t, use_inf=False):
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>old_np_seterr = np.seterr(invalid='<STR_LIT>')<EOL>try:<EOL><INDENT>kappa = abs(dx*ddy - dy*ddx)/sqrt(dx*dx + dy*dy)**<NUM_LIT:3><EOL><DEDENT>except (ZeroDivisionError, FloatingPointError):<EOL><INDENT>p = self.poly()<EOL>dp = p.deriv()<EOL>ddp = dp.deriv()<EOL>dx, dy = real(dp), imag(dp)<EOL>ddx, ddy = real(ddp), imag(ddp)<EOL>f2 = (dx*ddy - dy*ddx)**<NUM_LIT:2><EOL>g2 = (dx*dx + dy*dy)**<NUM_LIT:3><EOL>lim2 = rational_limit(f2, g2, t)<EOL>if lim2 < <NUM_LIT:0>:  <EOL><INDENT>return <NUM_LIT:0><EOL><DEDENT>kappa = sqrt(lim2)<EOL><DEDENT>finally:<EOL><INDENT>np.seterr(**old_np_seterr)<EOL><DEDENT>return kappa<EOL>
returns the curvature of the segment at t.

    Notes
    -----
    If you receive a RuntimeWarning, run command
    >>> old = np.seterr(invalid='raise')
    This can be undone with
    >>> np.seterr(**old)