From 855f5078cd89e78bedc1edd18bc700f1c837ce07 Mon Sep 17 00:00:00 2001 From: Stefan Kraemer Date: Tue, 15 Sep 2015 16:33:07 +0200 Subject: [PATCH] Bugfix for hyperbolic_arc and hyperbolic_polygon --- src/sage/plot/hyperbolic_arc.py | 3 ++- src/sage/plot/hyperbolic_polygon.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sage/plot/hyperbolic_arc.py b/src/sage/plot/hyperbolic_arc.py index 1e658fc84d5..11ab9e85277 100644 --- a/src/sage/plot/hyperbolic_arc.py +++ b/src/sage/plot/hyperbolic_arc.py @@ -7,6 +7,7 @@ """ #***************************************************************************** # Copyright (C) 2011 Hartmut Monien , +# 2015 Stefan Kraemer # # Distributed under the terms of the GNU General Public License (GPL) # @@ -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)) diff --git a/src/sage/plot/hyperbolic_polygon.py b/src/sage/plot/hyperbolic_polygon.py index e6465183e04..7bc97f336ca 100644 --- a/src/sage/plot/hyperbolic_polygon.py +++ b/src/sage/plot/hyperbolic_polygon.py @@ -8,7 +8,8 @@ """ #***************************************************************************** # Copyright (C) 2011 Hartmut Monien , -# 2014 Vincent Delecroix <20100.delecroix@gmail.com> +# 2014 Vincent Delecroix <20100.delecroix@gmail.com>, +# 2015 Stefan Kraemer # # Distributed under the terms of the GNU General Public License (GPL) # @@ -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))