Hi,
Working with Ellipse.is_tangent I found an issue at elif isinstance(o,
Polygon):

The Polygon class is not included in the ellipse module so we get the error.
I patch the code in the following way..

Regards,
Matteo


    def is_tangent(self, o):
        """Returns True if o is tangent to the ellipse, False otherwise."""
        from polygon import Polygon # <--- my patch 
        inter = None
        if isinstance(o, Ellipse):
            inter = self.intersection(o)
            return (inter is not None and isinstance(inter[0], Point) and
len(inter) == 1)
        elif isinstance(o, LinearEntity):
            inter = self._do_line_intersection(o)
            if (inter is not None) and len(inter) == 1:
                return (inter[0] in o)
            else:
                return False
        elif isinstance(o, Polygon): #<-- here I get the error
            c = 0
            for seg in o.sides:
                inter = self._do_line_intersection(seg)
                c += len([True for point in inter if point in seg])
            return (c == 1)
        else:
            raise NotImplementedError("Unknown argument type")

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to