Jump to content
  • Advertisement

Archived

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

langguy

Trig headache

This topic is 5220 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

When I put a value into acos/asin, I always get a value -Pi/2 < angle < Pi/2. But, I want to know how to get an angle 0 < angle < 2*Pi. Someone help please?

Share this post


Link to post
Share on other sites
Advertisement
That really only works for angles in the fourth quadrant. Angles that are Pi/2 < angle < 3*Pi/2 are still erroneous.

Share this post


Link to post
Share on other sites
You will have to find another way of doing this, not by asin/acos...
the reason? the sin and cos functions aren`t inversible in it entire domain (that`s it, [0,2*pi) ). The reason to this is that there are always two angles that have the same sin...
for example:

sin(pi/6)=0.5
sin(5*pi/6)=0.5

so, asin(0.5) would be pi/6 or 5*pi/6??
for that reason, the image of asin is defined only in 2 quadrants.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!