Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7. Program polarcoord.cpp: a. Write a function degrees2radians() which converts degrees to radians. The function has one parameter: an angle in degrees of type double.

image text in transcribed
7. Program polarcoord.cpp: a. Write a function degrees2radians() which converts degrees to radians. The function has one parameter: an angle in degrees of type double. The function returns a value of type double which is the angle in radians. The formula to convert degrees to radians is: where D is degrees and R is radians. Write a function compute_coord() which computes the Cartesian (x, y) coordinates of a point from its polar coordinates (radius, angle) where angle is measured in radians. The function has four parameters listed in the following order: b. i. the polar radius of the point, ii. the polar angle in radians of the point, iii. the x-coordinate of the point, the y-coordinate of the point. iv. All parameters should have type double. The first two parameters should be passed by value and the last two parameters should be passed by reference. The function does not return any value, but it modifies the last two parameters. The formula to compute the x and y-coordinates from the polar coordinates is: x- radiusx cos(angle) y radius sin(angle), where radius is the polar radius, angle is the angle measured in radians, x is the x coordinate and y is the y-coordinate of the point

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Information Modeling And Relational Databases

Authors: Terry Halpin, Tony Morgan

2nd Edition

0123735688, 978-0123735683

More Books

Students also viewed these Databases questions