viswanani's picture
Create drs/drs_engine.py
93aa0fe verified
raw
history blame contribute delete
409 Bytes
def is_in_line(x, y, zone):
return zone['x_min'] <= x <= zone['x_max'] and zone['y_min'] <= y <= zone['y_max']
def drs_decision(bounce, impact, stumps_hit):
pitch_zone = {'x_min': 1.5, 'x_max': 2.5, 'y_min': 0, 'y_max': 1} # Simplified
impact_zone = pitch_zone
if is_in_line(*bounce, pitch_zone) and is_in_line(*impact, impact_zone) and stumps_hit:
return "OUT"
return "NOT OUT"