Page 1 of 1

(b) [15 points] Two distances are required to specify the location of a point relative to an origin in two-dimensional s

Posted: Sat May 14, 2022 4:41 pm
by answerhappygod
B 15 Points Two Distances Are Required To Specify The Location Of A Point Relative To An Origin In Two Dimensional S 1
B 15 Points Two Distances Are Required To Specify The Location Of A Point Relative To An Origin In Two Dimensional S 1 (108.42 KiB) Viewed 44 times
(b) [15 points] Two distances are required to specify the location of a point relative to an origin in two-dimensional space (see figure): • The horizontal and vertical distances (1, y, z) in Cartesian coordinates. • The radius and angle (1, 0,6) in spherical coordinates It is relatively straightforward to compute Cartesian coordinates (1,9, 2) on the basis of polar coordinates (r,®). The reverse process is not so simple. The radius can be computed by the following formula r-V12 + y2 + 22 If the coordinates lie within the first and fourth coordinates (i.c., 1 >0, y > 0,2 > 0), then a simple formula can be used to compute e 8-cos -* (*) = tan y/) 2 Z (r, 0,0) X Write a well-structured M-file using if...elseif structures to calculate (r,8,4) as a function of (x,y,z). Express the coordinates for in degrees. Test your program by evaluating the following cases and finding the values of r, , and y (1,4,2)=(-1,1,-1),(1,3,2), (1, -2, -3),(-1,-3,-4)