mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	fixed random_spin() in three dimensions
This commit is contained in:
		| @@ -459,10 +459,10 @@ EX transmatrix spin(ld alpha) { return cspin(0, 1, alpha); } | ||||
| EX transmatrix random_spin() { | ||||
|   if(WDIM == 2) return spin(randd() * 2 * M_PI); | ||||
|   else { | ||||
|     ld alpha2 = acos(randd() * 2 - 1); | ||||
|     ld alpha2 = asin(randd() * 2 - 1); | ||||
|     ld alpha = randd() * 2 * M_PI; | ||||
|     ld alpha3 = randd() * 2 * M_PI; | ||||
|     return cspin(0, 2, alpha2) * cspin(0, 1, alpha) * cspin(1, 2, alpha3); | ||||
|     return cspin(0, 1, alpha) * cspin(0, 2, alpha2) * cspin(1, 2, alpha3); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue