• Create Account

## Imaginary #'s

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

3 replies to this topic

### #1MARS_999  Members

1588
Like
Likes
Like

Posted 25 July 2001 - 06:18 PM

Ok is their any use for imaginary numbers in games? If so can C/C++ handle a result if it''s imaginary? Is their a function for this? How would you go about this? e.g. x = sqrt(-2); this is the output from that statement -1.#IND Please forgive me! =)

### #2johnb  Members

351
Like
Likes
Like

Posted 25 July 2001 - 08:59 PM

I''ve not come across a direct application for complex/imaginary numbers in games. You can use them in the theory behind some concepts: e.g. when solving second order differential equations (used to model spring motion, such as in a car suspension) complex numbers help explain the difference between different sorts of damping. But in the final calculations you always avoid them: it''s generally much quicker to use special case code to handle a negative square root than to use complex numbers.

As for using them there are complex extensions to most programming languages, including C, and I think they''re part of the standard library in C++. Try searching for *complex*.* in your dev environment(s) to see what capabilities are provided.

### #3grhodes_at_work  Members

1377
Like
Likes
Like

Posted 27 July 2001 - 07:26 AM

To expand on johnb''s reply, imaginary numbers arise in determining the stability of numerical methods, say for physics integration. They wouldn''t be used *in* the game, but they would (and often *should*) be used to help you choose an appropriate integration method to ensure your physics are stable and don''t blow up numerically.

Imaginary numbers do also arise in some fast methods for simulating fluid flow, for example in thin wing and airfoil theory. I suppose they could be used directly *in* a game if you were to use these methods for, say, determining aerodynamic loads in airplane flight simulation. But you can usually get better aerodynamic loads using different methods so there''s no compelling reason to use these methods. They also arise in more advanced fluid simulations, such as the prediction of the transition of a flow from laminar to turbulent. There may be some interesting uses of this for games, who knows.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

### #4MARS_999  Members

1588
Like
Likes
Like

Posted 27 July 2001 - 11:24 AM

Thanks for all your help! That is why I love this site!

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.