Chris H
Chris H

Reputation: 271

How to calculate sin(alpha) = a in Python?

How can I calculated the angle in formula: sin(alpha) = a if I known a before.

Like example: sin(alpha) = 0.021 => alpha ?

Anybody can help me code the script to find out alpha value (angle)?

Thanks!

Upvotes: 0

Views: 1131

Answers (1)

pandalai
pandalai

Reputation: 426

It could be done with Math module. Here is code:

import math
# To calculate 90 radian
a = math.sin(90*(math.pi)/180)
print(a)
# 1.0
b = math.asin(1.0)*180/(math.pi)
print(b)
# 90.0

It works.

Upvotes: 1

Related Questions