Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started