Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6) You are stranded on a desert island and your only chance at escape depends on an accurate calculation of a navigation heading using

 

6) You are stranded on a desert island and your only chance at escape depends on an accurate calculation of a navigation heading using the inverse sine function (sin or arcsin). Fortunately you have a small computer with a C compiler along with you, but unfortunately it has only about 30 minutes of battery charge left. Fortunately it has math library routines for the sin and cosine functions, but unfortunately its limited operating system has no library function for the inverse sine. Fortunately you have taken Physics 3340, and you can remember the simple iteration formula of the rapidly converging Newton-Raphson algorithm, but unfortunately you don't have access to the roots.c class library code. However, with a little C coding, in a few minutes you have the answer. a) Write a function of x such that when the root of this function is found, x will be equal to sin(0.75) in radians. (Assume x is an angle in the first quadrant.): b) Write a simple C program for finding the root of this function with an initial guess of x=1 and a fixed five iterations of the Newton-Raphson algorithm. (The only math function calls your code may issue are to sin ( ) and cos() functions, and you may not call any class library code such as roots.c.) The program should output the current guess for x and the corresponding function value in each iteration. After its five iterations, your program should also call the function sin(x) and print out the result, as a verification of your solution.

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_2

Step: 3

blur-text-image_3

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

Big Java, Enhanced Early Objects

Authors: Cay S Horstmann

7th Edition

1119499097, 9781119499091

More Books

Students also viewed these Programming questions

Question

=1/How is risk measured in a market economy?

Answered: 1 week ago

Question

please can you make a full report about Multiplexing Techniques

Answered: 1 week ago

Question

4. Explain the qualitative research model.

Answered: 1 week ago