STRUGGLING

Started by
4 comments, last by Mercury 18 years, 7 months ago
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
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.
[ search: google ][ programming: msdn | boost | opengl ][ languages: nihongo ]
A good C++ site is : www.ultimategameprogramming.com
Its got C++ basic to advanced tutorials like game tutorials (www.gametutorials.com)
Or just google for : c++ tutorials

You'll find a lot!
"Take delight in the Lord and He will give you your heart's desires" - Psalm 37:4My Blog
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 bottom3. 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.
the sin() cos() functions are okay an'all, but do take into account the conversion of radions-to-angles and vice-versa.

Languages; C, Java. Platforms: Android, Oculus Go, ZX Spectrum, Megadrive.

Website: Mega-Gen Garage

Wiki knows all. There's a section in there called "Conversion between coordinate systems".

This topic is closed to new replies.

Advertisement