Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


complex pow() and log() etc..

This topic is 5427 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does somebody know any good and fast algorhitm for function complex pow(complex a, [ complex/double ] b) (or how to JUST COMPUTE power of a complex number) ... ln(.. ... log(... ..sqrt.....etc.etc.etc... thank you exa_einstein

Share this post

Link to post
Share on other sites
OK, two problems:
1) I don''t have < complex >
2) I want source of that function

maybe I should find somebody who will post link for some complex stuff (I''ve googled and haven''t find anything)

Share this post

Link to post
Share on other sites
You can derive it if you know Euler's formula:

e^(i*theta)=cos theta + i*sin theta

To derive:


You need to check this I am not sure it is correct.
I defined Im(x) in two different ways because sometimes one is undefined or not the one you want (ln is multivalued in the compex plain).

Arbitrary power
Which can be done using above definitions and complex multiplicaiton.

EDIT: Here are some tips on how to do others youi mentioned:
Square root
Same as arbitrary power with y=0.5

Logarithm Base-a

[edited by - sadwanmage on November 12, 2003 5:52:14 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!