Re: how to get the angle from the cosine, etc.

From: Stan Brown (the_stan_brown_at_fastmail.fm)
Date: 10/06/04


Date: Wed, 6 Oct 2004 07:36:50 -0400


"Sean Hunt" <seanstewarthunt@hotmail.com> wrote in sci.math:
> I'm actually looking for a way to get the angle (in radians), given
>that you already have the sine and cosine of the angle. I'm trying to
>derive an equation to go back and forth rather than a look-up process,

What do you mean by "an equation"? I'm guessing that you mean some
sort of polynomial, or at worst something involving only powers,
multiplication/division, and addition/subtraction. No such equation
can exist, because cos( ) is a transcendental function and so is its
inverse.

The only finite equation that is an answer to your question is
        angle = arccos(x)
where x is the cosine. (arccos is sometimes written as cos with a
superscript -- not exponent -- of -1.)

What we are forced to do is to _define_ the inverse cosine as a new
function. But since cosine is a many-to-one function, inverse cosine
would be a one-to-many function Therefore we pick an interval and
say that arccos(x) is always between 0 and pi. This has the good
effect that arccos( ) is now a function, but it does mean that we
can't write arccos(cos(theta)) = theta.

There are some issues with that. For instance, if the cosine is 1/2,
you might be tempted to say that the angle is pi/3. And indeed
arccos(1/2) = pi/3. But many other angles also have a cosine equal
to 1/2. The original angle could also be 5pi/3, or 2pi + pi/3, etc.
If you also know the sine, then you have a unique solution within
the interval [0, 2pi), but overall there are still an infinite
number of solutions.

> On the surface it looks like a fairly easy correlation, but I
>haven't been able to calculate the angle given sine and cosine. Now
>I'm beginning to think that this might be a calculus problem rather
>than a trigenometry problem.

Well, if you're willing to accept an infinite series, the calculus
can help. But no closed-form solution exists.

-- 
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
                                        http://OakRoadSystems.com
Fortunately, I live in the United States of America, where we are
gradually coming to understand that nothing we do is ever our
fault, especially if it is really stupid.            --Dave Barry


Relevant Pages

  • Re: Golly, that was easy...
    ... addition formulas for cosine and sine. ... 'a' to keep track of both the sine and cosine of the angle. ...
    (sci.physics)
  • Re: order of eigenvalues
    ... nearly parallel, there is a more accurate alternative as compared with finding ... vectors multiplied by the cosine of the angle between them. ... we can directly compute the absolute value of the sine of the angle ...
    (comp.soft-sys.matlab)
  • Re: how to get the angle from the cosine, etc.
    ... > that you already have the sine and cosine of the angle. ... If you know the sine, then you also know the cosine. ... is just the sine function translated by 90 degrees or PI/2 radians. ...
    (sci.math)
  • The Euler Equation: What does "e" have to do with sine & cosine?
    ... Euler Equation post... ... what does the number "e" have to do with sine and cosine? ... between (i.e. at an angle of pi/4 radians), and has a real part and an ...
    (sci.math)
  • Re: double pointers
    ... double sincostan(double angle, double *pcosine, double *ptangent) ... double cosine = cos; ... double tangent = tan; ... return sine; ...
    (comp.programming)