def intersect(self, other_seg, tol=<NUM_LIT>):
if isinstance(other_seg, Line):<EOL><INDENT>return bezier_by_line_intersections(self, other_seg)<EOL><DEDENT>elif (isinstance(other_seg, QuadraticBezier) or<EOL>isinstance(other_seg, CubicBezier)):<EOL><INDENT>assert self != other_seg<EOL>longer_length = max(self.length(), other_seg.length())<EOL>return bezier_intersections(self, other_seg,<EOL>longer_length=longer_length,<EOL>tol=tol, tol_deC=tol)<EOL><DEDENT>elif isinstance(other_seg, Arc):<EOL><INDENT>t2t1s = other_seg.intersect(self)<EOL>return [(t1, t2) for t2, t1 in t2t1s]<EOL><DEDENT>elif isinstance(other_seg, Path):<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>
Finds the intersections of two segments.
        returns a list of tuples (t1, t2) such that
        self.point(t1) == other_seg.point(t2).
        Note: This will fail if the two segments coincide for more than a
        finite collection of points.