Jump to content

PHP Funcrtions: Inverse sine


Tjk

Recommended Posts

I can't seem to find true inverse sine. I have tried asin and asinh and both give weird answers. Here's the code:

[code]
$opposite= 295;
$hyp= 375.298547826;

$sinx= $opposite/ $hyp;
$x= asin($sinx);
[/code]

This gives me an answer of 1.10573218834 when it should give me an answer of ~51.813

Is there a setting in php.ini i need to change? The script is being run on a linux server and running the latest version of PHP.

Any help is appreciated.
-Tjk

P.S: How do I use the php tags which colour the code. I haven't been able to find them. :)

EDIT: I managed to solve my own problem. (For anyone with a similiar problem) the answer is that asin always returns in radians therefore you need to use rad2deg() to convert the angle into degrees.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.