Question: Two distances are required to specify the location of a point relative to an origin in two-dimensional space (Figure): The horizontal and vertical distances (
Two distances are required to specify the location of a point relative to an origin in two-dimensional space (Figure):
-1.png)
- The horizontal and vertical distances ( x . y ) in Cartesian coordinates
- The radius and angle (r, θ) in radial coordinates.
It is relatively straightforward to compute Cartesian coordinates (x, y) on the basis of polar coordinates (r, θ). The reverse process is not so simple. The radius can be computed by the following formula: r = √ x2 + y2
If the coordinates lie within the first and fourth coordinates (i.e., x > 0), then a simple formula can be used to compute θ
θ = tan – 1 (y/x)
The difficulty arises for the other cases. The following table summarizes the possibilities:
-2.png)
(a) Write a well-structured flowchart for a subroutine procedure to calculate r and θ as a function of x and y. Express the final results for θ in degrees.
(b) Write a well-structured function procedure based on your flowchart. Test your program by using it to fill out following table:

IV II
Step by Step Solution
3.42 Rating (165 Votes )
There are 3 Steps involved in it
Here is a flowchart for the algorithm Students could implement the function in any number of languag... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
45-M-N-A-M-E-A (35).docx
120 KBs Word File
