
Two distances are required to specify the location of a point relative to an origin in two-dimensional space (Fig. P2.14):
The horizontal and vertical distances
The radius and angle
FIGURE P2.14
It is relatively straight forward to compute Cartesian coordinates
If the coordinates lie within the first and fourth coordinates
The difficulty arises for the other cases. The following table summarizes the possibilities:
x | Y |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 |
(a) Write a well-structured flowchart for a subroutine procedure to calculate r and
(b) Write a well-structured function procedure based on your flowchart. Test your program by using it to fill out the following table:
x | Y | r |
|
1 | 0 | ||
1 | 1 | ||
0 | 1 | ||
–1 | 1 | ||
–1 | 0 | ||
–1 | –1 | ||
0 | –1 | ||
1 | –1 | ||
0 | 0 |
(a)

A well-structured flowchart for a subordinate procedure to calculate r and
Answer to Problem 14P
Solution:
Explanation of Solution
Given Information:
To specify the location of a point relative to origin, cartesian coordinates
Cartesian coordinates can be easily computed from the polar coordinates.
Polar coordinates are computed as follows:
Formula used:
Calculation:
The flowchart for converting from Cartesian to polar coordinates is as follows
(b)

A well-structured function procedure based on flowchart of part (a) if two distances are required to specify the location of a point relative to an origin in two-dimensional space. Also, test the program by filling the table given below:
Answer to Problem 14P
Solution:
The values of r and
Explanation of Solution
Given Information:
To specify the location of a point relative to origin, cartesian coordinates
Cartesian coordinates can be easily computed from the polar coordinates.
Polar coordinates are computed as follows:
Calculation:
The MATLAB program for converting Cartesian to polar coordinates is as follows:
% Define a function polar()
function polar(x, y)
% Formula to calculate r
r = sqrt (x.^ 2+ y.^ 2);
if x > 0
% Formula to calculate theta
th= atan(y/ x);
elseif x < 0
% Use for loop to check the condition
if y > 0
th= atan(y / x)+ pi;
elseif y < 0
th= atan(y / x)- pi;
else
th= pi;
end
else
if y > 0
th= pi / 2;
elseif y < 0
th=- pi / 2;
else
th= 0;
end
end
theta = th* 180 / pi;
% Display the polar coordinates
fprintf('r = %4.4f theta = %4.2f\n',r,theta);
Now, to test the program use the following command.
First find polar coordinates for
OUTPUT:
Now, for polar coordinates for
OUTPUT:
Now, for polar coordinates for
OUTPUT:
Now, forpolar coordinates for
OUTPUT:
Now, forpolar coordinates for
OUTPUT:
Now, forpolar coordinates for
OUTPUT:
Now, forpolar coordinates for
OUTPUT:
Now, forpolar coordinates for
OUTPUT:
Now, forpolar coordinates for
OUTPUT:
Hence, the values of r and
Want to see more full solutions like this?
Chapter 2 Solutions
Numerical Methods for Engineers
Additional Math Textbook Solutions
Pathways To Math Literacy (looseleaf)
Math in Our World
Intermediate Algebra (13th Edition)
APPLIED STAT.IN BUS.+ECONOMICS
- Golden Ratio search Method f(x) = 2x^3 - 3x^2 - 12x + 1 Golden ratio search rules 1.If f(x) < f(x2): 1. Eliminate all x values less than x2 2. X2 becomes the new a 3. x, becomes the new x2 4. no change in b If f(x) > f(x2): 1. Eliminate all x values greater than x 2. x, becomes the new b 3. x2 becomes the new x 4. no change in aquesion=Narrow the interval in which the minimizer of the function f is located using the golden search method, starting with the initial interval (0,6], until its width is less than 2. Then, accept the midpoint of this interval as an approximate value of the minimizer of the function fand determine it. (ф=0.62)According to the question above, fill in the table below using the algorithm until the appropriate place.please write every step by step in a verry comprehensive wayarrow_forwardIn preparing for the upcoming holiday season, Fresh Toy Company (FTC) designed a new doll called The Dougie that teaches children how to dance. The fixed cost to produce the doll is $100,000. The variable cost, which includes material, labor, and shipping costs, is $31 per doll. During the holiday selling season, FTC will sell the dolls for $39 each. If FTC overproduces the dolls, the excess dolls will be sold in January through a distributor who has agreed to pay FTC $10 per doll. Demand for new toys during the holiday selling season is extremely uncertain. Forecasts are for expected sales of 60,000 dolls with a standard deviation of 15,000. The normal probability distribution is assumed to be a good description of the demand. FTC has tentatively decided to produce 60,000 units (the same as average demand), but it wants to conduct an analysis regarding this production quantity before finalizing the decision. (a) Determine the equation for computing FTC's profit for given values of the…arrow_forwardFor all integers a and b, (a + b)^4 ≡ a^4 + b^4 (mod 4).arrow_forward
- Let Χ be a real-valued character (mod k). Let k S = Σnx(n). n=1 If (a, k) = 1, ax(a)S = S (mod k). (iii) Write k = 2ºq where q is odd. Show that there is an integer a with (a, k) = 1 such that a = 3 (mod 2ª) and a = 2 (mod q). Deduce that 12S = 0 (mod k).arrow_forwardProve that (1) Σσς (α) μ(η/α) = n d/n (ii) Σσς(d) = η Σσο(α)/d d❘n d❘n (iii) σ (d) σ (n/d) = Σ d³oo(d) σo(n/d). d|n dnarrow_forwardhow to do part b,carrow_forward
- If p = 5 (mod 8), where p is prime, show that p|2 (P-1)/2 + 1. State and prove the corresponding result when p = 7 (mod 8). Deduce that 250 + 1 and 251 1 are composite. -arrow_forwardWhy the character no change for my remark?arrow_forwardIn preparing for the upcoming holiday season, Fresh Toy Company (FTC) designed a new doll called The Dougie that teaches children how to dance. The fixed cost to produce the doll is $100,000. The variable cost, which includes material, labor, and shipping costs, is $31 per doll. During the holiday selling season, FTC will sell the dolls for $39 each. If FTC overproduces the dolls, the excess dolls will be sold in January through a distributor who has agreed to pay FTC $10 per doll. Demand for new toys during the holiday selling season is extremely uncertain. Forecasts are for expected sales of 60,000 dolls with a standard deviation of 15,000. The normal probability distribution is assumed to be a good description of the demand. FTC has tentatively decided to produce 60,000 units (the same as average demand), but it wants to conduct an analysis regarding this production quantity before finalizing the decision. (a) Determine the equation for computing FTC's profit for given values of the…arrow_forward
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:CengageTrigonometry (MindTap Course List)TrigonometryISBN:9781337278461Author:Ron LarsonPublisher:Cengage Learning
