- Code: Select all
`math.asin(math.sin(10)) ==10`

False

why does not the inverse sin give back 10?

5 posts
• Page **1** of **1**

Last edited by Yoriz on Thu Apr 04, 2013 5:31 am, edited 1 time in total.

**Reason:** *Added Code tags, altered title a little*

- augre
**Posts:**2**Joined:**Thu Apr 04, 2013 12:46 am

basically, the unit used in sin function is referring to radian instead of degree.

radian has a range of 0 ~ 2pi,

while degree has a range of 0 ~ 360

for example

sin(math.pi) #in radian

is equal to

sin(180) #in degree.

so yeah, you need to convert it first before using it, but since it's python, we're talking about, they might already defined a function to do so.

radian has a range of 0 ~ 2pi,

while degree has a range of 0 ~ 360

for example

sin(math.pi) #in radian

is equal to

sin(180) #in degree.

so yeah, you need to convert it first before using it, but since it's python, we're talking about, they might already defined a function to do so.

- siestamadokaist
**Posts:**12**Joined:**Sun Mar 31, 2013 4:48 pm

siestamadokaist wrote:, but since it's python, we're talking about, they might already defined a function to do so.

http://docs.python.org/2/library/math.html#angular-conversion

- setrofim
**Posts:**288**Joined:**Mon Mar 04, 2013 7:52 pm

Thanks!

10

- Code: Select all
`from math import asin, sin, radians, degrees`

print degrees(asin(radians(sin(10))))

10

- augre
**Posts:**2**Joined:**Thu Apr 04, 2013 12:46 am

Should be

i.e. sin(radians()) not radians(sin())

- Code: Select all
`>>> from math import asin, sin, radians, degrees`

>>> print degrees(asin(sin(radians(10))))

10.0

i.e. sin(radians()) not radians(sin())

- setrofim
**Posts:**288**Joined:**Mon Mar 04, 2013 7:52 pm

5 posts
• Page **1** of **1**

Users browsing this forum: No registered users and 9 guests