samedi 20 mars 2021

Sample points from a hyperboloid

A hyperboloid has the formula

-x^2/a^2 - y^2/b^2 + z^2/c^2 = 1.

How can I generate samples from this hyperboloid in Python? (Say, with a=b=c=1.)

I was thinking to pick random x and y in [0,1] and then fill in the z value that would make the formula equal 1. However this would not sample uniformly. Is there a better way?




Aucun commentaire:

Enregistrer un commentaire