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, 7 Ed
Additional Math Textbook Solutions
Pathways To Math Literacy (looseleaf)
Math in Our World
Intermediate Algebra (13th Edition)
APPLIED STAT.IN BUS.+ECONOMICS
- 4. Prove the following. Use full sentences. Equations in the middle of sentences are fine, but do not use logical symbols. (a) (b) (n+3)2 is odd for every even integer n. It is not the case that whenever n is an integer such that 9 | n² then 9 | n.arrow_forward3. (a) (b) Prove the following logical argument using the rules of inference. Do not make use of conditional proof. Vx(J(x)O(x)) 3x(J(x) A¬S(x)) . ·.³x(O(x) ^ ¬S(x)) Rewrite the proof using full sentences, avoiding logical symbols. It does not need to mention the names of rules of inference, but a fellow CSE 16 student should be able to understand the logical reasoning.arrow_forwardNo chatgpt pls will upvote Already got wrong chatgpt answerarrow_forward
- 16.4. Show that if z' is the principal value, then 1+e** z'dz = (1-i), 2 where is the upper semicircle from z = 1 to z = -1.arrow_forwardL 16.8. For each of the following functions f, describe the domain of ana- lyticity and apply the Cauchy-Goursat Theorem to show that f(z)dz = 0, where is the circle |2|=1:1 (a). f(z) = 1 z 2 + 2x + 2 (b). f(z) = ze*. What about (c). f(z) = (2z-i)-2?arrow_forward16.3. Evaluate each of the following integrals where the path is an arbitrary contour between the limits of integrations (a). [1 ri/2 edz, (b). (b). La cos COS (2) d dz, (c). (z−3)³dz. 0arrow_forward
- Q/ prove that:- If Vis a finite dimensional vector space, then this equivalence relation has only a single equivalence class.arrow_forward/ prove that :- It is easy to check that equivalence of norms is an e quivalence relation on the set of all norms on V.arrow_forward3) Let R be a set of real number and d:R2 R R such that d((x, y), (z, w)) = √(x-2)² + (y-w)² show that d is a metric on R².H.Warrow_forward
- No chatgpt pls will upvote Already got wrong chatgpt answerarrow_forwardNo chatgpt pls will upvote Already got wrong chatgpt answerarrow_forwardQ1: For, 0 <|z| < 1, evaluate the following integral where g is analyfunction inside and on the unit circle C: α) δε a) Sc 15 αξί b) Sc 9(5) -1/2 d. -2 1.'s integrale عناarrow_forward
- Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:CengageTrigonometry (MindTap Course List)TrigonometryISBN:9781337278461Author:Ron LarsonPublisher:Cengage Learning