HackerRank Python - Find Angle MBC




You are given the lengths AB and BC.
Your task is to find



  1. # Enter your code here. Read input from STDIN. Print output to STDOUT
  2. import math
  3. ab = float(input())
  4. bc = float(input())
  5. ac = math.sqrt((ab*ab)+(bc*bc))
  6. bm = ac / 2.0
  7. mc = bm
  8. #let,
  9. b = mc
  10. c = bm
  11. a = bc
  12. #where b=c
  13. angel_b_radian = math.acos(a / (2*b))
  14. angel_b_degree = int(round((180 * angel_b_radian) / math.pi))
  15. output_str = str(angel_b_degree)+'°'
  16. print(output_str)




codesadda.com

Codesadda.com is your home of programming solutions, tutorials, video tutorials and much more. Sign Up for our weekly newsletter to get update about new content.

Like us on Facebook | Connect with us on LinkedIn | Subscribe our Channel on Youtube