Write an application to convert a 2D point represented in rectangular coordinates to its polar representation (and the other way around).
(electronic music)…- [Instructor] Here's a challenge to test what you've…learned about mathematical functions…in the math.h header file.…This time, you must write some code to convert…a two-dimensional point represented in Cartesian,…or rectangular, coordinates to polar coordinates…and the other way around.…I'll clarify this shortly.…As always, remember that we want you to experiment…with the functions in math.h,…and you shouldn't worry about special cases,…like, for example, a user entering something…other than a number.…
Just to be clear, here's what you need to calculate…to perform coordinate conversions.…A point P in a two-D plane can be represented by using two…of the four parameters shown, Px, Py, r, and theta.…In Cartesian coordinates,…P is represented as the pair Px, Py.…In polar coordinates, P is represented as the pair r…for radius, and theta, which is the angle,…and we'll express it in degrees.…
Px and Py are calculated as r cosine of theta…and r sine of theta, respectively.…The radius is calculated as the hypotenuse…
- Working with header files
- C constants and types
- Unformatted and formatted input/output
- Accessing files with C functions
- Generating random numbers
- Converting strings
- Sorting and searching for data
- Manipulating strings
- Using mathematical functions
Skill Level Intermediate
C++ Standard Template Librarywith Eduardo Corpeño2h 23m Advanced
1. The C Standard Library
2. Input and Output Library: stdio.h
3. General Purpose: stdlib.h
4. String Functions: string.h
5. Mathematical Functions: math.h
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.