[Tutor] trig functions
Corran Webster
cwebster@nevada.edu
Wed, 10 May 2000 17:48:13 -0700
At 5:06 PM -0600 10/5/00, satori wrote:
> Hey gang,
>
> I've looked through a few of the Python books and I can't find this. Can we
> do trig functions (specifically cos and sin) in Python?
Yep - the standard math functions (and constants like pi) are available in
the math module. Just do
from math import *
and away you go. See the documentation for exactly which functions are
available (it's basically what you get from C's math.h, I think).
> I'm doing a school assignment (university), nobody's heard of Python in the
> lab
> (including the lab instructors) and I can use the language of my choice.
> I'd like to use Python if I can.
>
> I want to build 3 3x3 arrays, filling one with data from the user, the
> second with answers to trig-based functions and the third by doing a matrix
> multiplication (which I will write) multiplying the first and second arrays.
If you are doing matrix based stuff, have a look at numerical python (sorry
I don't have the URL handy, but it's available at www.sourceforge.org). Of
course if it's an assignment, using a specialised package may be considered
as having too much assistance from outside sources.
Regards,
Corran