Archived

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

jedis1000

C++ Square Roots

Recommended Posts

Ok, so heres the deal... I like to think of myself as an OK programmer. I''m no really into the heavy math yet, I''m still on simple little functions and stuff. So here is my story. The other day I was doing my physics homework for my 9th grade class. I had done about a gizillion of the same problems in a row. You know the type: D = (((time squared) * gravity) /2) This would get you the vertical distance for an object falling toward earth with a gravity that you can input. My program worked! I had a few problems in the beginning, but they were all sorted out. My new question is for another of my homework cheating tools.(haha) I want to try to use this formula now: (((Distance * 2) / Gravity)) and then it would take the square root of everything between the first and last perenthesis. How would I take a square root of all of that? Help would be greatly appreciated on this one. Ah the joys of making a faster way to do my homework. lol -Thanks

Share this post


Link to post
Share on other sites
quote:
Original post by Fruny
The sqrt() function is found in the cmath header.


[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]



Roger that.. Thanks Deprecation Nazi I strive to be standard.


daveandrews.org, soon to be home to a GAPI Sprite Engine.

Share this post


Link to post
Share on other sites
quote:
Original post by Ronin Magus
Roger that.. Thanks Deprecation Nazi I strive to be standard.



Heh, I had not even seen your post, but if you wish to consider that as a deserved lashing, be my guest


[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]

Share this post


Link to post
Share on other sites
Thanks a lot guys!
Now I have a whole set of physics homework helper outers. This would include:
Vertical Distance Formulas, Horizontal Distance Formulas, and now the time formula.
-Thanks for the help!

Share this post


Link to post
Share on other sites