5
$\begingroup$

I am trying to select points uniformly at random from the Poincare disk model of hyperbolic geometry:

showpts[t_] := Module[{}, reg = Disk[{0, 0}, 0.99];
  pts = RandomPointConfiguration[
    InhomogeneousPoissonPointProcess[
     Function[4/(t^2 (1 - ((#1)^2 + (#2)^2))^2)], 2], reg];
  Show[RegionPlot[reg], ListPlot[pts]]]
showpts[1]

But this returns with a division by zero problem,

enter image description here

If I run this with a disk radius of 0.91 I get the same problem. I would have thought that would easily avoid the problem of the point process density being undefined at the boundary of the disk.

The code works with a disk radius of 0.9,

showpts[t_] := Module[{}, reg = Disk[{0, 0}, 0.9];
  pts = RandomPointConfiguration[
    InhomogeneousPoissonPointProcess[
     Function[4/(t^2 (1 - ((#1)^2 + (#2)^2))^2)], 2], reg];
  Show[RegionPlot[reg], ListPlot[pts]]]
showpts[1]

enter image description here

Is this the cause of the problem?

$\endgroup$
1
  • 4
    $\begingroup$ Guessing at the fringes there can be machine double computations that underflow to zero. $\endgroup$ Jun 17, 2022 at 16:10

1 Answer 1

6
$\begingroup$

WorkingPrecision -> 80 seems work.

t = 1;
 RandomPointConfiguration[
 InhomogeneousPoissonPointProcess[
  Function[4/(t^2 (1 - ((#1)^2 + (#2)^2))^2)], 2], Disk[{0, 0}, .95], 
 WorkingPrecision -> 80]
Show[Graphics[Circle[]], ListPlot[%]]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.