Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
lerping solution in Creative category for Shooting Range by veky
def shot(*a):
A, B, C, D = (x + y * 1j for x, y in a)
X, Y, Z = A - B, D - C, A - C
j = lambda E, F: (E * F.conjugate()).imag
n = j(X, Y)
try:
r = j(Z, Y) / n
s = min(r, 1 - r)
assert s >= 0 > j(Z, X) * n
return round(200 * s)
except (ZeroDivisionError, AssertionError):
return -1
Aug. 28, 2014
Comments: