Odd behaviour in computation of intersection in Poincare Disc

asked 2024-02-21 13:58:23 +0200

Rowing0914 gravatar image

I'm trying to compute the intersection of two geodesics in the Poincare disc. My code is a bit too long to paste here so let me just share the short-link to it.
Anyway, I'm getting the following error in the intersection computation in a part of the code. Error message is ValueError: negative number cannot be raised to a fractional power.

So, i printed out the geodesics involved in this computation as follows;

Geodesic in PD from 0.9173343623719807 + 0.3981176554884141*I to 0.39811765407683164 + 0.9173343629845988*I
Geodesic in PD from -0.4409894081700523 + 0.8975123073706717*I to 0.7311976448002898 + 0.6821656721343501*I

Now, I understood that this much larger float-point precision sits behind these printed out numbers but I tried to reproduce the error as follows;

from sage.geometry.hyperbolic_space.hyperbolic_interface import HyperbolicPlane

PD = HyperbolicPlane().PD()

l1 = PD.get_geodesic(0.9173343623719807 + 0.3981176554884141 * I, 0.39811765407683164 + 0.9173343629845988 * I)
l2 = PD.get_geodesic(0.4409894081700523 + 0.8975123073706717 * I, 0.7311976448002898 + 0.6821656721343501 * I)
l1.intersection(l2)

But this time I'm getting the ValueError: geodesics don't intersect...

Could someone tell me why I can't reproduce the error?

edit retag flag offensive close merge delete

Comments

Also asked at https://stackoverflow.com/q/78034167/.... Do the comments there address the problem sufficiently?

John Palmieri gravatar imageJohn Palmieri ( 2024-02-21 19:57:34 +0200 )edit

@John Palmieri Sorry for my cross-post... I thought i had left the comment about my cross-post but somehow it's been lost... anyway, I think I'm close to the issue underneath the above issue (the computed base points of Geodesics weirdly being outside the Poincare disk..). So I will look into it! Thank you for checking!

Rowing0914 gravatar imageRowing0914 ( 2024-02-21 23:41:07 +0200 )edit

@John Palmieri In the end, I couldn't fix this issue.. and I'm stuck at another issue while debbuging this issue... could you have a look at it? https://ask.sagemath.org/question/76236/float-point-precision-in-instantiation-of-point-in-hyperbolic-geometry-module/ (https://ask.sagemath.org/question/762...)

Rowing0914 gravatar imageRowing0914 ( 2024-02-26 15:16:00 +0200 )edit