1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

preliminary randomPointIn

This commit is contained in:
Zeno Rogue 2018-08-20 16:36:45 +02:00
parent 13e5c3a555
commit e72758c973

View File

@ -356,6 +356,11 @@ transmatrix cellrelmatrix(cell *c, int i) {
double randd() { return (rand() + .5) / (RAND_MAX + 1.); }
hyperpoint randomPointIn(int t) {
if(irr::on || gp::on || archimedean) {
// Let these geometries be less confusing.
// Also easier to implement ;)
return xspinpush0(2 * M_PI * randd(), asinh(randd() / 20));
}
while(true) {
hyperpoint h = xspinpush0(2*M_PI*(randd()-.5)/t, asinh(randd()));
double d =