Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Bugfix for hyperbolic_arc and hyperbolic_polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Kraemer committed Sep 15, 2015
1 parent 559f73b commit 855f507
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/sage/plot/hyperbolic_arc.py
Expand Up @@ -7,6 +7,7 @@
"""
#*****************************************************************************
# Copyright (C) 2011 Hartmut Monien <monien@th.physik.uni-bonn.de>,
# 2015 Stefan Kraemer <skraemer@th.physik.uni-bonn.de>
#
# Distributed under the terms of the GNU General Public License (GPL)
#
Expand Down Expand Up @@ -70,7 +71,7 @@ def _hyperbolic_arc(self, z0, z3, first=False):
the hyperbolic arc between the complex numbers z0 and z3 in the
hyperbolic plane.
"""
if (z0-z3).real() == 0:
if abs((z0-z3).real()) < 10.**(-3):
self.path.append([(z0.real(),z0.imag()), (z3.real(),z3.imag())])
return
z0, z3 = (CC(z0), CC(z3))
Expand Down
5 changes: 3 additions & 2 deletions src/sage/plot/hyperbolic_polygon.py
Expand Up @@ -8,7 +8,8 @@
"""
#*****************************************************************************
# Copyright (C) 2011 Hartmut Monien <monien@th.physik.uni-bonn.de>,
# 2014 Vincent Delecroix <20100.delecroix@gmail.com>
# 2014 Vincent Delecroix <20100.delecroix@gmail.com>,
# 2015 Stefan Kraemer <skraemer@th.physik.uni-bonn.de>
#
# Distributed under the terms of the GNU General Public License (GPL)
#
Expand Down Expand Up @@ -85,7 +86,7 @@ def _hyperbolic_arc(self, z0, z3, first=False):
the hyperbolic arc between the complex numbers z0 and z3 in the
hyperbolic plane.
"""
if (z0-z3).real() == 0:
if abs((z0-z3).real()) < 10.**(-3):
self.path.append([(z0.real(), z0.imag()), (z3.real(), z3.imag())])
return
z0, z3 = (CC(z0), CC(z3))
Expand Down

0 comments on commit 855f507

Please sign in to comment.