1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-10 06:16:00 +00:00

used cyclefix and raddif in more places; (c)spin90, (c)spin180 and spin180 functions; rephrased M_PI in terms of TAU and x._deg when applicable

This commit is contained in:
Zeno Rogue
2022-11-12 22:38:45 +01:00
parent 563b9c1f74
commit 06523e063e
100 changed files with 750 additions and 757 deletions

View File

@@ -93,7 +93,7 @@ ld hrandd() {
ld gaussian_random() {
ld u1 = hrandd();
ld u2 = hrandd();
return sqrt(-2*log(u1)) * cos(2*M_PI*u2);
return sqrt(-2*log(u1)) * cos(TAU*u2);
}
void apply_delta(cellwalker cw, kohvec& v) {
@@ -226,9 +226,9 @@ void get_coordinates(kohvec& v, cell *c, cell *c0) {
alloc(v);
int s = T0[0][0];
for(int i=0; i<3; i++) {
hyperpoint h1 = spin(120*degree*i) * h;
hyperpoint h1 = spin(120._deg*i) * h;
ld x = h1[1];
ld alpha = 2 * M_PI * x / s / (sqrt(3) / 2);
ld alpha = TAU * x / s / (sqrt(3) / 2);
// println(hlog, kz(x), " -> ", kz(alpha));
v[2*i] = cos(alpha);
v[2*i+1] = sin(alpha);
@@ -250,7 +250,7 @@ void get_coordinates(kohvec& v, cell *c, cell *c0) {
auto& T0 = eu_input.user_axes;
for(int i=0; i<3; i++) {
int s = T0[i][i];
ld alpha = 2 * M_PI * h[i] / s;
ld alpha = TAU * h[i] / s;
v[2*i] = cos(alpha) * s;
v[2*i+1] = sin(alpha) * s;
}

View File

@@ -358,7 +358,7 @@ void distribute_neurons() {
if(!triangulate(data[s].val, w, find, vdata[id].m->at))
vdata[id].m->at =
spin(2*M_PI*w.csample / w.drawn_samples) * xpush(rad * (w.drawn_samples-1) / w.drawn_samples);
spin(TAU*w.csample / w.drawn_samples) * xpush(rad * (w.drawn_samples-1) / w.drawn_samples);
w.csample++;
for(auto& e: vdata[id].edges) e.second->orig = nullptr;
}

View File

@@ -735,7 +735,7 @@ void shot_settings() {
brm_limit = GDIM == 2 ? 1000 : 0;
if(GDIM == 3)
View = cspin(0, 2, 30 * degree) * cspin(1, 2, 30*degree) * View;
View = cspin(0, 2, 30 * degree) * cspin(1, 2, 30._deg) * View;
shift_view(ctangent(2, -0.5));