tags:

views:

184

answers:

4

How can you find the sin(i) with Sage?

I am trying to do some complex analysis with Sage.

The following commands are not working

sin(i)
sinh(i)
A: 

i am unfamiliar with sage, but in python the imaginary unit is denoted 1j, not i. maybe that will help? it may also be that the sage functions are defined as only over the reals and there are specific ones for over the complex plane in a different namespace.

Autoplectic
+2  A: 

These two chapters will provide some good background:

From that, you can get your answer:

ComplexNumber(0,1).sin()
Iceman
+4  A: 

Try

CDF(0,1).sin()  # or ComplexDoubleField(0,1)   CDF is just a shorthand

or

sin(CDF(0,1))

or

sin(1.0*I) # note the .0 to make it a float

Essentially CDF() creates a double-based complex number; the first argument is the complex part the second the imaginary part.
ComplexDoubleElement() does the same (I think less tolerant of "odd" types).
I'm not sure of the relation of these with ComplexNumber(). (maybe the latter is just simple precision ?)

All expressions above return approximately (rounding w/ float arithmetic?)

1.17520119364*I
mjv
+2  A: 

You just need to use a cap I, so in sage

I*I = -1

And

N(sin(I)) = 1.17520119364380*I

At least this works for the online notebook.

tom10