Repository: sympy/sympy

Issue:
Ellipse comparison with other geometric entities throws an error
This code throws an error whereas one would expect it to return `False`:
```python
from sympy.geometry import *
Circle(Point(1, 2), 3) == Line(Point(0,0), Point(0,1))
```

The error is:
```
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "/usr/lib/python3.5/site-packages/sympy/geometry/ellipse.py", line 1246, in __eq__
    return isinstance(o, GeometryEntity) and (self.center == o.center and
AttributeError: 'Line' object has no attribute 'center'

```
This is because of the [method `__eq__` of sympy.geometry.ellipse]( https://github.com/sympy/sympy/blob/master/sympy/geometry/ellipse.py#L128) only checks that the second entity is of type GeometryEntity before accessing attributes specific to Ellipse.

Discussion:

Patch:
diff --git a/sympy/geometry/ellipse.py b/sympy/geometry/ellipse.py
index e8f0b4fd12..44668154b1 100644
--- a/sympy/geometry/ellipse.py
+++ b/sympy/geometry/ellipse.py
@@ -127,7 +127,7 @@ def __contains__(self, o):
 
     def __eq__(self, o):
         """Is the other GeometryEntity the same as this ellipse?"""
-        return isinstance(o, GeometryEntity) and (self.center == o.center and
+        return isinstance(o, Ellipse) and (self.center == o.center and
                                                   self.hradius == o.hradius and
                                                   self.vradius == o.vradius)
 


Test patch:
diff --git a/sympy/geometry/tests/test_ellipse.py b/sympy/geometry/tests/test_ellipse.py
index d83e128092..029ad75e39 100644
--- a/sympy/geometry/tests/test_ellipse.py
+++ b/sympy/geometry/tests/test_ellipse.py
@@ -25,6 +25,7 @@ def test_ellipse_geom():
     c1 = Circle(p1, 1)
     c2 = Circle(p2, 1)
     c3 = Circle(Point(sqrt(2), sqrt(2)), 1)
+    l1 = Line(p1, p2)
 
     # Test creation with three points
     cen, rad = Point(3*half, 2), 5*half
@@ -39,6 +40,7 @@ def test_ellipse_geom():
     assert Ellipse(None, 1, 1).center == Point(0, 0)
     assert e1 == c1
     assert e1 != e2
+    assert e1 != l1
     assert p4 in e1
     assert p2 not in e2
     assert e1.area == pi