mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-30 21:42:59 +00:00 
			
		
		
		
	fixes to parabolic
This commit is contained in:
		| @@ -728,7 +728,7 @@ EX transmatrix parabolic1(ld u) { | |||||||
|  |  | ||||||
| EX transmatrix parabolic13(ld u, ld v) { | EX transmatrix parabolic13(ld u, ld v) { | ||||||
|   if(euclid) |   if(euclid) | ||||||
|     return ypush(u); |     return eupush3(0, u, v); | ||||||
|   else { |   else { | ||||||
|     ld diag = (u*u+v*v)/2; |     ld diag = (u*u+v*v)/2; | ||||||
|     return matrix4( |     return matrix4( | ||||||
| @@ -740,27 +740,21 @@ EX transmatrix parabolic13(ld u, ld v) { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
| EX hyperpoint parabolic10(hyperpoint h) { |  | ||||||
|   if(euclid) { h[LDIM] = 1; return h; } |  | ||||||
|   else if(MDIM == 4) return hyperpoint(sinh(h[0]), h[1]/exp(h[0]), h[2]/exp(h[0]), cosh(h[0])); |  | ||||||
|   else return hyperpoint(sinh(h[0]), h[1]/exp(h[0]), cosh(h[0]), 0); |  | ||||||
|   } |  | ||||||
|  |  | ||||||
| EX hyperpoint deparabolic10(const hyperpoint h) { |  | ||||||
|   if(euclid) return h; |  | ||||||
|   ld x = -log(h[LDIM] - h[0]); |  | ||||||
|   if(MDIM == 3) return hyperpoint(x, h[1] * exp(x), 1, 0); |  | ||||||
|   return point31(x, h[1] * exp(x), h[2] * exp(x)); |  | ||||||
|   } |  | ||||||
|  |  | ||||||
| /** this looks correct */ |  | ||||||
| EX hyperpoint deparabolic13(hyperpoint h) { | EX hyperpoint deparabolic13(hyperpoint h) { | ||||||
|   h /= (1 + h[3]); |   if(euclid) return h; | ||||||
|   hyperpoint one = point3(1,0,0); |   h /= (1 + h[LDIM]); | ||||||
|   h -= one; |   h[0] -= 1; | ||||||
|   h /= sqhypot_d(3, h); |   h /= sqhypot_d(LDIM, h); | ||||||
|   h[0] += .5; |   h[0] += .5; | ||||||
|   return point3(log(2) + log(-h[0]), h[1] * 2, h[2] * 2); |   return point3(log(2) + log(-h[0]), h[1] * 2, LDIM==3 ? h[2] * 2 : 0); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  | EX hyperpoint parabolic13(hyperpoint h) { | ||||||
|  |   if(euclid) return h; | ||||||
|  |   else if(LDIM == 3) | ||||||
|  |     return parabolic13(h[1], h[2]) * xpush0(h[0]); | ||||||
|  |   else | ||||||
|  |     return parabolic1(h[1]) * xpush0(h[0]); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| EX transmatrix spintoc(const hyperpoint& H, int t, int f) { | EX transmatrix spintoc(const hyperpoint& H, int t, int f) { | ||||||
|   | |||||||
| @@ -723,7 +723,7 @@ EX void apply_other_model(shiftpoint H_orig, hyperpoint& ret, eModel md) { | |||||||
|         models::apply_orientation(H[0], H[1]); |         models::apply_orientation(H[0], H[1]); | ||||||
|         } |         } | ||||||
|        |        | ||||||
|       ret = hyperbolic ? deparabolic10(H) : H; |       ret = hyperbolic ? deparabolic13(H) : H; | ||||||
|       ret *= .5; |       ret *= .5; | ||||||
|       ret[LDIM] = 1; |       ret[LDIM] = 1; | ||||||
|        |        | ||||||
|   | |||||||
| @@ -772,7 +772,7 @@ hyperpoint ray_kleinize(hyperpoint h, int id, ld pz) { | |||||||
|   if(hyperbolic && bt::in()) { |   if(hyperbolic && bt::in()) { | ||||||
|     // ld co = vid.binary_width / log(2) / 4; |     // ld co = vid.binary_width / log(2) / 4; | ||||||
|     // hyperpoint res = point31(h[2]*log(2)/2, h[0]*co, h[1]*co); |     // hyperpoint res = point31(h[2]*log(2)/2, h[0]*co, h[1]*co); | ||||||
|     return deparabolic10(bt::parabolic3(h[0], h[1]) * xpush0(log(2)/2*h[2])); |     return deparabolic13(bt::bt_to_minkowski(h)); | ||||||
|     } |     } | ||||||
|   #endif |   #endif | ||||||
|   if(prod) { |   if(prod) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue