Expressing Arccos in Terms of Arctan
Date: 02/24/97 at 13:07:04 From: John Neubert Subject: arccos func. in QBasic The following is for my son. He is doing a science project involving asteroidal orbits for which he needs to create a Basic (QBasic) program to run his simulation. He has been able to handle all the math and programming, but has run into a snag in that Basic only has arctan as a built-in function (ATN). The books all say that from this, one can create the other functions. My son needs the equation for arccos using arctan in its definition. He has come up with the following (HOWEVER, after coding, it does not give a valid answer when checked): cos x = 1 / (sec x) (tan x)^2 + 1 = (sec x)^2 cos x = 1 / ((tan x)^2 + 1)^.5 arccos x = 1 / ((ATN x)^2 + 1)^.5 It has been many years since I've worked with this, but his first three steps seem valid. It's the last one that looses me where he substitutes arccos for cos and arctan (ATN) for tan. He says this is valid. Do you see any errors in the above? When he programs it he creates a function with the QBasic "Function" command it produces invalid results. Can you help him? Thank you very much.
Date: 03/07/97 at 19:21:32 From: Doctor Luis Subject: Re: arccos func. in QBasic Obtaining the other inverse trig functions from arctan x is not difficult. Drawing a right triangle with unit hypotenuse can help visualize the derivation: C /| / | / | / | 1 / | / | / | sqrt(1-x^2) [sqrt(z) means z^0.5] / | / | /_________| A B x Now, consider both the cosine and the tangent of angle A: cos A = x/1 = x tan A = (sqrt(1-x^2))/x Clearly, A = arccos(x) and also A = arctan((sqrt(1-x^2))/x). Therefore, arcos(x) = arctan((sqrt(1-x^2))/x). The above expression gives the arccos(x) function in terms of x (which is given) and the arctan (or ATN) function. I hope this helped. -Doctor Luis, The Math Forum Check out our web site! http://mathforum.org/dr.math/
Date: 03/07/97 at 19:13:38 From: Doctor Ken Subject: Re: arccos func. in QBasic Hi - Your instincts are correct, but the last step isn't valid. If we could do this kind of thing, we could do some pretty bizarre things with math! For instance, your son's step was this: cos x = 1 / ((tan x)^2 + 1)^.5 arccos x = 1 / ((ATN x)^2 + 1)^.5 Now, if we could substitute inverse functions on both sides of an equation, we would be able to do things like this: 1 = 1 x + 1 = x + 1 x + 1 = (x - 1) + 2 Now plug in inverse functions - on the left, the inverse function of x is x, and the inverse function of x-1 is x+1: x + 1 = (x + 1) + 2 x + 1 = x + 3 1 = 3 So you can see that in general this technique won't produce valid results. For a geometric demonstration of how you _can_ produce a formula for arccos in terms of arctan, Dr. Luis' method (above) works just fine. -Doctor Ken, The Math Forum Check out our web site! http://mathforum.org/dr.math/
Search the Dr. Math Library:
Ask Dr. MathTM
© 1994-2015 The Math Forum