BSuruchi commited on
Commit
687dbec
1 Parent(s): b3a3e79

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -30,12 +30,14 @@ def calculateAngle(landmark1, landmark2, landmark3):
30
  '''
31
 
32
  # Get the required landmarks coordinates.
33
- x1, y1, _ = landmark1
34
- x2, y2, _ = landmark2
35
- x3, y3, _ = landmark3
36
 
37
- # Calculate the angle between the three points
38
  angle = math.degrees(math.atan2(y3 - y2, x3 - x2) - math.atan2(y1 - y2, x1 - x2))
 
 
39
 
40
  # Check if the angle is less than zero.
41
  if angle < 0:
 
30
  '''
31
 
32
  # Get the required landmarks coordinates.
33
+ x1, y1 = landmark1.x, landmark1.y
34
+ x2, y2 = landmark2.x, landmark2.y
35
+ x3, y3 = landmark3.x, landmark3.y
36
 
37
+ # Calculate the angle between the three points
38
  angle = math.degrees(math.atan2(y3 - y2, x3 - x2) - math.atan2(y1 - y2, x1 - x2))
39
+ angle = abs(angle) # Convert the angle to an absolute value.
40
+
41
 
42
  # Check if the angle is less than zero.
43
  if angle < 0: