gudhi-devel
gudhi-devel copied to clipboard
Random points on the surface of a 2-torus
I tried this stackoverflow method to generate random points on the surface of a 2-torus and it works fine.
Contrarily to generate_points_on_torus_3D
, cf. the result for 300 random points:
A python interface would also be nice, but we would have to re-think the interface to distinguish random points on a flat and a surface torus. Maybe with sample='surface'
, and that would force to use dim=2
.
The picture you show is the "grid" version, there is also a more random version if you pass different arguments. On the other hand, the name of that argument (uniform
) is bogus, since it does not give a uniform sample, the density is a bit higher towards the inside. This is a problem that we discussed already when Hind was here. There are general methods to make the sampling uniform (https://github.com/tdaverse/tdaunif, I think I had also sent a link to a paper explaining the math).