Jump to content
  • Advertisement
Sign in to follow this  
oceangirl2012

STRUGGLING

This topic is 4812 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

Hi all, I am new at C++ and have to complete an assignment for uni. It requires me to make a C++ program which converts polar co-ordinates to cartesian co-ordinates. If you have any advice or solutions please let me know it would be much appreciated. Cheers Trent Rhodes

Share this post


Link to post
Share on other sites
Advertisement
HOMEWORK. I assume you know how to convert them mathematically. In that case, I suggest you Google math routines in C++. Here's a tip: sin and cos do exist, and work as expected. Also, if it's just the basics of C++ you're having trouble with, google for tutorials in that too. There's plenty out there, have fun.

Share this post


Link to post
Share on other sites
As with the above posters, never underestimate the power of [Google]. To find what you are looking for do the following:


1. Open up google and query "converts polar coordinates to cartesian coordinates"
- There will be a page that tells mathmatically how to do it.
2. Now open a new window and do a google query for "text input with C++"
- Unlike the last result, you will need to scan down the list some towards the bottom
3. Now that you know how to get input and show output, and you know the math
behind it, you just need to find the C++ math statements. Do a google seach for "C++ sin cos"
- As a general rule, look for MSDN pages when looking for functions first. It
shows an example and what header file to include.


Now that you've done all of that, it's just a matter of completing the assigment. You'll want to simply ask the user for input, process that input, then show the output. That general process is one that you will always be using with C++, Input->Process->Ouput. Good luck!

P.S. If you have a computer science book with your class, look in the index for sin/cos and cin/cout.

Share this post


Link to post
Share on other sites
the sin() cos() functions are okay an'all, but do take into account the conversion of radions-to-angles and vice-versa.

Share this post


Link to post
Share on other sites

This topic is 4812 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.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • 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!