This was previously reported as issue #32362 on github <https://github.com/sagemath/sage/issues/32362>, so any further discussion should take place there. The solution suggested there is to have sagemath calculate endpoints in the Poincare disk model, instead of in the upper half plane model.
On Sunday, August 11, 2024 at 7:45:18 AM UTC-4 Hakan Granath wrote: > Hi, > > There is a bug in hyperbolic_polygon which happens quite rarely, but for > example > > l = [-1, 1, -0.0571909584179366 + 0.666666666666667*I] > hyperbolic_polygon(l, model='PD') > > results in an incorrectly drawn hyperbolic triangle. It seems to be a > subtle numerical issue; if the last element of l is replaced with > -0.0571909584179366 + 0.667*I everything looks fine. > > Digging a bit further, there seems to be an underlying issue here: > > PD = HyperbolicPlane().PD() > z0 = CC(-0.0571909584179366 + 0.666666666666667*I) > z1 = CC(-1) > PD.get_geodesic(z0, z1).ideal_endpoints() > > yields the erroneous result > > [Boundary point in PD -9.52420782539595e-17 + 1.00000000000000*I, > Boundary point in PD -0.800000000000000 + 0.600000000000000*I] > > (the second endpoint should be -1). Because of this I am suspicious of > lines 1267 - 1269 in > src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py. There we have > the code > > # We could also have a vertical line with two interior points > if x1 == x2: > return [M.get_point(x1), M.get_point(infinity)] > > Maybe the if statement should instead be something like > > if abs(x1 - x2) < EPSILON: > > Best regards, > > Håkan Granath > > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/baff7122-26e0-40a1-8bbf-0f2fc36e88d2n%40googlegroups.com.