Jump to content
  • Advertisement
Sign in to follow this  
Portishead

[C#]Math.Sin() is wrong?

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Math.Sin(30) suppose to give 0.5, but when I did it, it gave me a negative number. What's wrong with it? Math.Sinh() is the same as SHIFT SinX in a caculator?

Share this post


Link to post
Share on other sites
Advertisement
Since there are Pi radians per 180 degrees, you need to multiply the argument of sin by Math.PI/180.

e.g. Math.Sin(30 * Math.PI/180) is sin of 30 degrees.

edit: I just saw your question about Math.Sinh: sinh is hyperbolic sin. Just like sin gives the y-component of the angle parameterization of the curve x^2+y^2=1, sinh gives the y-component corresponding to an angle-like parameterization of the hyperbolic curve x^2-y^2=1

You can find more on wikipedia if you're interested: Hyperbolic Sin

Share this post


Link to post
Share on other sites
Oh, wow, haven't got there in math yet.

Is there a function to get X from SinX? [Like doing SHIFT SinX in a calculator(not the computer one)]

Share this post


Link to post
Share on other sites
Quote:
Original post by Portishead
Oh, wow, haven't got there in math yet.

Is there a function to get X from SinX? [Like doing SHIFT SinX in a calculator(not the computer one)]


Math.Asin, if I understood your question correctly.

You have b = Sin(X), and you want to know what X is, right?
Then X = Math.Asin(b), it's the inverse sine function (sin-1)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!