Ask Your Question
1

Finding Re() and Im() for complex numbers

asked 13 years ago

SirFibonacci gravatar image

Hey guys,

Is there a way to find the real and imaginary parts of a complex number in Sage? If so, how is it done?

Thanks.

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
3

answered 13 years ago

Shashank gravatar image

.real() for real part .imag() for imaginary part

For eg.

(3+i*4).real()=3

(3+i*4).imag()=4
Preview: (hide)
link

Comments

Derp. Thanks so much.

SirFibonacci gravatar imageSirFibonacci ( 13 years ago )
1

answered 13 years ago

calc314 gravatar image

real_part(z) and imag_part(z) also work.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 13 years ago

Seen: 15,051 times

Last updated: Feb 19 '12