dotfiles/scripts/speedrun-finder

31 lines
616 B
Plaintext
Raw Permalink Normal View History

2022-02-06 19:45:28 +01:00
#!/bin/python
import math
parts = input("First point? ").split(" ")
x1,z1,a1 = float(parts[6]),float(parts[8]),float(parts[9])
if a1 >= 90:
a1 = 180 - a1+90
else:
a1 = -1 * (a1+90)
s1 = -1 * math.tan(math.radians(a1))
i1 = z1 - s1 * x1
parts = input("Second point? ").split(" ")
x2,z2,a2 = float(parts[6]),float(parts[8]),float(parts[9])
if a2 >= 90:
a2 = 180 - a2+90
else:
a2 = -1 * (a2+90)
s2 = -1 * math.tan(math.radians(a2))
i2 = z2 - s2 * x2
x3 = (i2 - i1) / (s1 - s2)
z3 = s1 * x3 + i1
print(f"Stronghold at: {round(x3)}, {round(z3)}")
print(f"In nether: {round(x3/8)}, {round(z3/8)}")