Find Angle in Python

Given a right angled triangle ABC, right angled at B. Find angle ABD, where D is the mid-point of the hypotenuse(side AC). You will be given two integers denoting sides AB and BC respectively. Round off your answer to the nearest Integer.

Input Format
First line will contain an Integer denoting side AB.
Second line will contain an Integer denoting side BC.


Constraints
1 <= side AB <= 200
1 <= side BC <= 200


output
Output Angle ABD, rounded off to nearest integer.
Sample TestCase 1
Input case
6
6


output
45
Solution:


import sys
import math
def main():

# Write code here
adjacent=input()
opposite=input()
#since tan=opposite/adjacent
tangent=opposite/adjacent
sys.stdout.write(str(int(math.degrees(math.atan(tangent)))))

main()

Comments

Post a Comment

Popular posts from this blog

Reasoning-Letter Series

Reasoning-Number Series

Multiply Negative numbers in java