sine in python

A

Astan Chee

Hi,
I have a math function that looks like this
sin (Theta) = 5/6
How do I find Theta (in degrees) in python? I am aware of the math.sin
function, but is there a reverse? maybe a sine table in python?
Thanks
Astan

--
"Formulations of number theory: Complete, Consistent, Non-trivial. Choose two."


Animal Logic
http://www.animallogic.com

Please think of the environment before printing this email.

This email and any attachments may be confidential and/or privileged. If you are not the intended recipient of this email, you must not disclose or use the information contained in it. Please notify the sender immediately and delete this document if you have received it in error. We do not guarantee this email is error or virus free.
 
Z

zillow10

Hi,
I have a math function that looks like this
sin (Theta) = 5/6
How do I find Theta (in degrees) in python? I am aware of the math.sin
function, but is there a reverse? maybe a sine table in python?
Thanks
Astan

--
"Formulations of number theory: Complete, Consistent, Non-trivial. Choose two."

Animal Logichttp://www.animallogic.com

Please think of the environment before printing this email.

This email and any attachments may be confidential and/or privileged. If you are not the intended recipient of this email, you must not disclose or use the information contained in it. Please notify the sender immediately and delete this document if you have received it in error. We do not guarantee this email is error or virus free.

import math
If you now do
dir(math)
you'll see that the module has the functions 'asin' and 'degrees' that
find the inverse sine of a number, and convert radians to degrees,
respectively
 
D

Dan Bishop

import math
If you now do
dir(math)
you'll see that the module has the functions 'asin' and 'degrees' that
find the inverse sine of a number, and convert radians to degrees,
respectively

Better yet, do

help(math)

which will display the docstrings.
 
M

Mark Wooding

Astan Chee said:
I have a math function that looks like this
sin (Theta) = 5/6
How do I find Theta (in degrees) in python?

import math
theta = math.asin(5/6) * 180/math.pi

-- [mdw]
 
C

Carl Banks

import math
theta = math.asin(5/6) * 180/math.pi


Careful there, bud. 5/6 might not give you the value you're expecting
it to, depending on the version of Python you're using. If you're on
Python 2.x, you'll want to use "from __future__ import division", or
to specify 5 and 6 as floats, i.e., 5.0/6.0.

(And people claim 5/6 == 0 is the "obvious" result....)


Carl Banks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top