[net.math] need help

rjr@mgweed.UUCP (Bob Roehrig) (01/31/84)

Perhaps some math whiz can help me out with a problem.
I have a computer program that gives me an answer that is
the sin of x. How can I get the value of x without an
arc-sin function? My computer just has sin, cos, tan
and arc-tan. (I also have the formula ACS(x)=-ATN(x/sqr(-x*x+1))+pi/2
which gives me the arc-cosine function).

Tnx  Bob

ags@pucc-i (Seaman) (02/01/84)

>  Perhaps some math whiz can help me out with a problem.
>  I have a computer program that gives me an answer that is
>  the sin of x. How can I get the value of x without an
>  arc-sin function? My computer just has sin, cos, tan
>  and arc-tan. (I also have the formula ACS(x)=-ATN(x/sqr(-x*x+1))+pi/2
>  which gives me the arc-cosine function).
>  
>  Tnx  Bob

If y = sin(x) and

   -PI/2 < x < PI/2

then cos(x) = sqrt(1-sin^2(x)) = sqrt(1-y^2)

and tan(x) = sin(x) / cos(x) = y / sqrt(1-y^2)

so that arcsin(y) = x = arctan(y/sqrt(1-y^2))


-- 

Dave Seaman
..!pur-ee!pucc-k:ags

"Against people who give vent to their loquacity 
by extraneous bombastic circumlocution."

leichter@yale-com.UUCP (Jerry Leichter) (02/03/84)

The request was for a way to compute arcsin(x), given sin(x).  This is
actually quite easy.  Given x, you want y = arcsin(x); or, inverting the
equation, you want to solve for y, given sin(y) = x.  A Newton-Raphson
approximation should be quite effective.  Recall that to solve f(y)=x
for y, you will need to be able to compute f and its first derivative.
Since f=sin, you have that; and f'=cos, which you also have since
cos(x)=sin(90-x) (in degrees).
							-- Jerry

rpw3@fortune.UUCP (02/05/84)

#R:mgweed:-668600:fortune:6200004:000:747
fortune!rpw3    Feb  5 01:13:00 1984

You have a formula for arc-cosine, and you have sin(x), so if you
could go from sin(x) ==> cos(x) you could arc-cos(cos(x)) and be home, eh?

Well, look at a unit circle and note that (sin(x))^2 + (cos(x))^2 = 1^2 = 1,
since the sine and cosine are the opposite and adjacent of a right triangle
of hypoteneuse (sp?) 1 (i.e., radius of the unit circle), by the Pythagorean
Theorem.

So cos(x) = sqrt(1 - (sin(x)^2).

All details of guessing which quadrant "x" was originally from are left
to the student. No way to know, from the info given. I assume here 1st 
quadrant. Don't.

Rob Warnock

UUCP:	{sri-unix,amd70,hpda,harpo,ihnp4,allegra}!fortune!rpw3
DDD:	(415)595-8444
USPS:	Fortune Systems Corp, 101 Twin Dolphins Drive, Redwood City, CA 94065