Last active
August 29, 2015 14:23
-
-
Save zeimusu/75f58b48e093109047e5 to your computer and use it in GitHub Desktop.
Find a Minecraft stronghold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Find a minecraft stronghold | |
#To find a stronghold you need an eye of ender, which you throw into the air. | |
#Make a note of your current location and the direction in which the eye goes. | |
#You can find these from the F3 debug screen. | |
#Move to a second point (it should be reasonably distant from the first) | |
#Throw the eye again and note the second point and direction. Enter | |
#the numbers below and run. It outputs the location of the stronghold. | |
point1 = (142,-155) | |
direction1 = -54.9 * (pi/180) | |
point2 = (714, -201) | |
direction2 = 0.9 * (pi/180) | |
vector1=(-sin(direction1),cos(direction1)) | |
vector2=(-sin(direction2),cos(direction2)) | |
det=vector1[0]*vector2[1]-vector2[0]*vector1[1] | |
#if abs(det)<0.01: # not needed? | |
# print("Points are aligned, accuracy reduced") | |
ldet = vector2[1]*(point2[0]-point1[0]) - vector2[0]*(point2[1]-point1[1]) | |
mdet = vector1[1]*(point2[0]-point1[0]) - vector1[0]*(point2[1]-point1[1]) | |
stronghold = ( int(point1[0]+ ldet/det * vector1[0]) ,int(point1[1] | |
+ldet/det*vector1[1])) | |
strongchck = ( int(point2[0]+ mdet/det * vector2[0]) , int(point2[1] | |
+mdet/det*vector2[1])) | |
print("Stronghold found at coordinates",stronghold) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment