Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Ray and Segment solution in 3rd party category for Shooting Range by fed.kz
from sympy import Ray, Segment
def shot(wall1, wall2, shot_point, later_point):
p1 = Segment(wall1, wall2)
p2 = Ray(shot_point, later_point)
i = p1.intersection(p2)
if i: return 100 - round(i[0].distance(p1.midpoint)*200/p1.length)
return -1
Jan. 28, 2019
Comments: