mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-11-04 07:43:02 +00:00 
			
		
		
		
	reduced epsilons in hyperpoint
This commit is contained in:
		@@ -505,7 +505,7 @@ EX hyperpoint normalize(hyperpoint H) {
 | 
				
			|||||||
/** like normalize but makes (ultra)ideal points material */
 | 
					/** like normalize but makes (ultra)ideal points material */
 | 
				
			||||||
EX hyperpoint ultra_normalize(hyperpoint H) {
 | 
					EX hyperpoint ultra_normalize(hyperpoint H) {
 | 
				
			||||||
  if(material(H) <= 0) {
 | 
					  if(material(H) <= 0) {
 | 
				
			||||||
    H[LDIM] = hypot_d(LDIM, H) + 1e-6;
 | 
					    H[LDIM] = hypot_d(LDIM, H) + 1e-10;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  return normalize(H);
 | 
					  return normalize(H);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
@@ -760,7 +760,7 @@ EX hyperpoint parabolic13(hyperpoint h) {
 | 
				
			|||||||
EX transmatrix spintoc(const hyperpoint& H, int t, int f) {
 | 
					EX transmatrix spintoc(const hyperpoint& H, int t, int f) {
 | 
				
			||||||
  transmatrix T = Id;
 | 
					  transmatrix T = Id;
 | 
				
			||||||
  ld R = hypot(H[f], H[t]);
 | 
					  ld R = hypot(H[f], H[t]);
 | 
				
			||||||
  if(R >= 1e-12) {
 | 
					  if(R >= 1e-15) {
 | 
				
			||||||
    T[t][t] = +H[t]/R; T[t][f] = +H[f]/R;
 | 
					    T[t][t] = +H[t]/R; T[t][f] = +H[f]/R;
 | 
				
			||||||
    T[f][t] = -H[f]/R; T[f][f] = +H[t]/R;
 | 
					    T[f][t] = -H[f]/R; T[f][f] = +H[t]/R;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -774,7 +774,7 @@ EX transmatrix spintoc(const hyperpoint& H, int t, int f) {
 | 
				
			|||||||
EX transmatrix rspintoc(const hyperpoint& H, int t, int f) {
 | 
					EX transmatrix rspintoc(const hyperpoint& H, int t, int f) {
 | 
				
			||||||
  transmatrix T = Id;
 | 
					  transmatrix T = Id;
 | 
				
			||||||
  ld R = hypot(H[f], H[t]);
 | 
					  ld R = hypot(H[f], H[t]);
 | 
				
			||||||
  if(R >= 1e-12) {
 | 
					  if(R >= 1e-15) {
 | 
				
			||||||
    T[t][t] = +H[t]/R; T[t][f] = -H[f]/R;
 | 
					    T[t][t] = +H[t]/R; T[t][f] = -H[f]/R;
 | 
				
			||||||
    T[f][t] = +H[f]/R; T[f][f] = +H[t]/R;
 | 
					    T[f][t] = +H[f]/R; T[f][f] = +H[t]/R;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -853,7 +853,7 @@ EX transmatrix ggpushxto0(const hyperpoint& H, ld co) {
 | 
				
			|||||||
    return mscale(PIU(ggpushxto0(d.second, co)), d.first * co);
 | 
					    return mscale(PIU(ggpushxto0(d.second, co)), d.first * co);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  transmatrix res = Id;
 | 
					  transmatrix res = Id;
 | 
				
			||||||
  if(sqhypot_d(GDIM, H) < 1e-12) return res;
 | 
					  if(sqhypot_d(GDIM, H) < 1e-16) return res;
 | 
				
			||||||
  ld fac = -curvature()/(H[LDIM]+1);
 | 
					  ld fac = -curvature()/(H[LDIM]+1);
 | 
				
			||||||
  for(int i=0; i<GDIM; i++)
 | 
					  for(int i=0; i<GDIM; i++)
 | 
				
			||||||
  for(int j=0; j<GDIM; j++)
 | 
					  for(int j=0; j<GDIM; j++)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user