Question
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)
Solution
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
OTHER TIPS
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.
These two chapters will provide some good background:
From that, you can get your answer:
ComplexNumber(0,1).sin()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow