DSatishchandra commited on
Commit
3af5cba
·
verified ·
1 Parent(s): ec7c037

Create lbw_logic.py

Browse files
Files changed (1) hide show
  1. lbw_logic.py +13 -0
lbw_logic.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def decide_lbw(analysis_data):
2
+ trajectory = analysis_data["trajectory"]
3
+ if not trajectory or len(trajectory) < 2:
4
+ return "Not Out (Insufficient data)"
5
+
6
+ # Simplified logic: check trajectory alignment
7
+ start_x = trajectory[0][0]
8
+ end_x = trajectory[-1][0]
9
+
10
+ if abs(end_x - start_x) < 30:
11
+ return "Out (Straight trajectory hitting stumps)"
12
+ else:
13
+ return "Not Out (Ball missing stumps)"