Find Angle MBC

Sort by

recency

|

871 Discussions

|

  • + 0 comments

    Place coordinates:

    𝐵 ( 0 , 0 ) , 𝐴 ( 𝑎 , 0 ) , 𝐶 ( 0 , 𝑏 ) B(0,0),A(a,0),C(0,b).

    Midpoint

    𝑀

    ( 𝑎 / 2 ,    𝑏 / 2 ) M=(a/2,b/2).

    Form vectors:

    𝐵 𝑀

    ( 𝑎 / 2 ,    𝑏 / 2 ) BM =(a/2,b/2)

    𝐵 𝐶

    ( 0 ,    𝑏 ) BC =(0,b)

    Dot product formula:

    cos ⁡

    𝜃

    𝐵 𝑀 ⃗ ⋅ 𝐵 𝐶 ⃗ ∣ 𝐵 𝑀 ⃗ ∣ ∣ 𝐵 𝐶 ⃗ ∣ cosθ= ∣ BM ∣∣ BC ∣ BM ⋅ BC ​

    Simplify:

    cos ⁡

    𝜃

    𝑏 𝑎 2 + 𝑏 2 cosθ= a 2 +b 2 ​

    b ​

    Find angle:

    𝜃

    cos ⁡ − 1  ⁣ ( 𝐵 𝐶 𝐴 𝐵 2 + 𝐵 𝐶 2 ) θ=cos −1 ( AB 2 +BC 2 ​

    BC ​

    )

    Round to nearest integer if needed.

  • + 0 comments

    A different solution without tangent.

    import math
    
    def main():
        # a = AB and b = BC
        a, b = int(input()), int(input())
        # c = AC (hypotenuse)
        c = math.hypot(a, b)
    
        # Calculate angle A (opposite side a)
        # using the law of cosines
        cos_A = (b**2 + c**2 - a**2) / (2 * b * c)
        angle_A_rad = math.acos(cos_A)
        angle_A_deg = math.degrees(angle_A_rad)
        print(f"{round(angle_A_deg)}\u00B0")
    
    if __name__ == "__main__":
        main()
    
  • + 0 comments

    This is how you find angle MBC with degree sign: Syntax:

    import math ab=int(input()) bc=int(input()) print(f"{str(round(math.degrees(math.atan2(ab,bc))))}\u00B0")

  • + 0 comments

    import math

    a,b= int(input()), int(input())

    print(str(round(math.degrees(math.atan2(a,b))))+chr(176))

  • + 0 comments

    Being well versed in the math class helps the most:

    # Enter your code here. Read input from STDIN. Print output to STDOUT
    import math
    
    AB = int(input())
    BC = int(input())
    
    
    
    AC = math.sqrt((AB ** 2) + (BC ** 2))
    print(f"{round(math.degrees(math.acos(BC/AC)))}\N{DEGREE SIGN}")