A float is equalling -1.0#IND for some reason
float PlaneSize = 2.0f * (float)sqrtf((SQR(aRadius)-SQR(pRadius)));
float PlaneDelta = PlaneSize/(float)Divisions;
aRadius is 15
pRadius is 2500...
SQR(x) is simply: SQR(x) (x*x)
For some reason PlaneSize is coming out as -1.#IND000
This of course cause's Planedelta to be -1.#IND000 which then cause's every vertice I generate for the plane to be -1.#IND000
What on earth is going on? Em I exceeding the float max or what?
Re: A float is equalling -1.0#IND for some reason
LoL.
I'm an idiot, trying to take the squareRoot of a negetive number...
If only sqrt was equiped with the knowledge of imaginary number k.
Re: A float is equalling -1.0#IND for some reason
Ah, but that's what std::complex from <complex> is for. Floating point numbers are a subset of rational numbers, which in turn are a subset of real numbers. You need complex numbers to represent imaginary parts.
Re: A float is equalling -1.0#IND for some reason
Is there nothing the STD cannot do...
It seems endless...
Do they put you through a crash course on the STD in computer science?
Re: A float is equalling -1.0#IND for some reason
No, I did that myself by reading the MSDN docs and several books on C++. If you want, I can give you a short overview over my library.
Re: A float is equalling -1.0#IND for some reason
Sure, I'd love a good listing of resources based on that topic.
It is obviously something a good c++ needs to know.
Re: A float is equalling -1.0#IND for some reason
OK, let's see then.
My first C++ book was called, I believe, "Beginning Visual C++". I would not recommend that. It basically teaches MFC.
The second book I got was "C/C++ Kompendium". It's a German book, and although the author's name sounds English, I haven't ever been able to find an English version. It's a really good book, covering even the weirder aspects of C and C++. It also has a very handy reference section for the standard libraries.
The third book was Charles Petzold's "Programming Windows". It's still THE resource for starting Windows programming, although it's written for C. Shortly after that, I got "Application Programming with Microsoft Windows" by Jeffrey Richter, which I owe most of my deeper Windows knowledge to.
Then I took up interest in game programming for a while. I got a wide range of books, among them Andre LaMothe's "Tricks of the Windows Game Programming Gurus", which for the first time made me realize what a COM object is. The "Game Programming Gems" series (by now 5 books, I think, though I only have the first three) also contains a wide range of peculiar information, which comes in handy at times.
All during this time, I spent an awful lot of time here - I believe at one point I had a posting rate of about 12 posts per day. I read the questions and attempted to answer them even if I didn't know the answer: I went back to my books, or went out on the web and researched. I acquired an enormous amount of C++ trivia this way. That's usually the stuff that makes me look smart on these forums.
Rather recently, then, I bought another big load of books. "Effective C++", "More Effective C++" and "Effective STL" by Scott Meyers are all a must. "C++ Gotchas" by Dewhurst is great as well. All four give you deep insight into the more tricky aspects of the language.
"C++ Templates" by Vandevoorde and Josuttis is the hardcode one. It really contains everything you need to know to really understand the power of templates, the quite incredible things you can do with them.
For actual usage of them, "Modern C++ Design" by Alexandrescu is a wonderful book that basically introduces the Loki library, a library of reusable template components, covering various design patterns like Singletons, Factories and Visitors.
But not many people realize that C++ templates, entirely by accident, were designed so that they now form a real programming language. The C++ template systems, aside from compiler limitations, forms a Turing-complete functional programming language. Some people realized that, and they wrote a "standard library" for that language. That's the Boost Metaprogramming Library, and one of my most recent acquirements is "C++ Template Metaprogramming" by Abrahams and Gurtovoy, which introduces this library, and some other Boost libraries.
Very nice for large program design, although I haven't yet finished this book, is "Mullti-Paradigm Design for C++". It encourages you to use the fact that C++ is not a pure OO-language like many other recent languages (Java, C#), and to program with multiple paradigms in your mind.
And finally, for some important but rarely found information about the standard library, "Standard C++ IOStreams and Locales" by Langer and Kraft covers the I/O stream and localization parts of the standard C++ library in depth.