- Prepare
- Python
- Math
- Find Angle MBC
- Discussions

# Find Angle MBC

# Find Angle MBC

+ 36 comments We can Solve this problem by using a property: ** That a median on the hypotenuse divides the right angled triangle in two isoceles triangle.** * Means AM=BM=CM * So, ∡MBC = ∡MCB

Now find ∡MCB [You can use 'tan' ]

`import math`

`AB = int(raw_input())`

`BC = int(raw_input())`

`print str(int(round(math.degrees(math.atan2(AB,BC)))))+'°'`

+ 10 comments import math AB,BC=int(input()),int(input()) hype=math.hypot(AB,BC) #to calculate hypotenuse res=round(math.degrees(math.acos(BC/hype))) #to calculate required angle degree=chr(176) #for DEGREE symbol print(res,degree, sep='')

+ 22 comments This problem in incorrect.

This problem states that the output should be angle MBC in degrees. However, all test cases seem to expect angle ACB instead.

Using rules of geometry, we should be able to find angle ACB using tangent rule tan(C) = AB/BC. Then, the angle MBC can be calculated as 180 - 90 - ACB.

In test case 1, AB is given as length 1 and BC is given as length 10. This yields an angle ACB around 6 degrees, meaning angle MBC should be about 84 degrees. Instead the expected solution is 6 degrees.

+ 1 comment This question is a troll. Here is the second test case input and output:

1 10

6Â°

I think the author is exploting some strange python 2 unicode bug to annoy people. The 'correct solution' is whatever produces the particular character output that the author has defined, rather than the mathematically correct result as defined by the problem spec.

+ 1 comment Guys, you need really to get rid of using Unicode here, because people are having problems with Unicode. What is the sense of using that pattern of answer? You said, the that the answer must be in degrees. Why the people should solve problems with unicode? This task is mathematical task, not the task with strings. You even disabled it in Python 3! So, having those facts, don't you think that the task should be fixed?

Sort 613 Discussions, By:

Please Login in order to post a comment