Archived

This topic is now archived and is closed to further replies.

formula for inverse sine?

This topic is 5286 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

It happends to be that the language im writing my car game in doesn't have inverse sine and cos functions. It only has normal sin and cos. So how in the world am I supposed to calculate the inverse sin and cos? Anyone knows the formula for these two functions?  though it has atan, could that be of any help? [edited by - angry on April 5, 2004 12:38:44 PM]

Share on other sites
I think this is correct:
asin(s) = atan(s/sqrt(1-s*s))

Share on other sites
You can do something similar with the inverse cosine, but only if -pi/2 < acos(x) < pi/2. Then acos(x) = atan(sqrt(1 - x^2) / x).

You could always do it the old-skool way and use a lookup table... Or switch to a language with a sensible set of standard functions. No inverse trig functions, sheesh! What is this, 1968?

[edited by - Muzzafarath on April 5, 2004 2:30:36 PM]

Share on other sites
quote:
Or switch to a language with a sensible set of standard functions. No inverse trig functions, sheesh! What is this, 1968?

LoL, well the language is called Lingo and is used for making "movies" in a program called Director. These "movies" can then be exported to shockwave movies, which then can be viewed on normal webpages...

Thanks for the replies!

Share on other sites
Arcsin(X) = Atn(X / Sqr(-X * X + 1))

is the equation your looking for...

Share on other sites
Is there an echo in here?

Share on other sites
quote:
Original post by Muzzafarath
You can do something similar with the inverse cosine, but only if -pi/2 < acos(x) < pi/2. Then acos(x) = atan(sqrt(1 - x^2) / x).

You could always do it the old-skool way and use a lookup table... Or switch to a language with a sensible set of standard functions. No inverse trig functions, sheesh! What is this, 1968?

[edited by - Muzzafarath on April 5, 2004 2:30:36 PM]

Actually VB doesn''t either......

Share on other sites
quote:
Original post by Muzzafarath
Actually VB doesn''t either......

thought we were speaking about programming languages?

Share on other sites
Hmmm... This is not as accurate (since the series was not expanded far enough) as the method using atan but had there been no atan you could have done it so:

asin(n)
{
return n + power(n, 3)/ Factorial(3) + 9 *power(n, 5)/ Factorial(5) + 225 *power(n, 7)/ Factorial(7);
}

acos(n)
{
return PI/ 2 - asin(n);
}

Share on other sites
[insert rant about how people should be using java applets for games, instead of trying to shoehorn the game into shockwave/flash, here]

1. 1
2. 2
3. 3
4. 4
Rutin
13
5. 5

• 12
• 15
• 9
• 14
• 10
• Forum Statistics

• Total Topics
632655
• Total Posts
3007675
• Who's Online (See full list)

There are no registered users currently online

×