We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Math
- Find Angle MBC
- Discussions
Find Angle MBC
Find Angle MBC
Sort by
recency
|
884 Discussions
|
Please Login in order to post a comment
Gotta use trigonometry Like relate hyp to angle angle to height and base of small tringle MBC=atan(h/b)
from math import atan2, degrees
AB = int(input()) BC = int(input()) final1 = atan2(AB,BC) final2 = (round(degrees(final1))) print(str(final2) + chr(176))
import math AB = float(input()) BC = float(input()) t_rad = math.atan(AB/BC) t = round(math.degrees(t_rad)) print(f"{t}\u00b0")
I believe this has a mistake and we are actually meant to solve for angle MCB. the use of atan(AB/BC) solved all cases.
import math
AB= float(input()) BC= float(input()) print(f'{int(round(math.degrees(math.atan(AB/BC)),0))}\u00b0')
The probelm pressented to us to find angle MBC not trivial as the triangle MBC is not guarrantied to be a right anlge triangle. If we dont have a right triangle we need to use law of cosine or law of sines. Using atan we can get angle BCM, with that we can then solve for length BM using law. once here we can use either law of sin or cosin to solve for angleMBC
import math AB=float(input()) BC=float(input()) t_rad = math.asin((AB/2)/BC) t = round(math.degrees(t_rad)) print(f"{t}\u00b0")
this code gives input 30 degree but if i replace asin with atan it gives 45 and also passes all the testcase.but here we shoud use asin rather than atan...anyone tell?am i right or wrong