   Reverse Sin,Cos,Tan
  i wanted to calculate the sin^-1 of some angle to get the original angle so i did this [sourcecode lang = cpp]int ReverseSin(double value){int x;double TVal1,TVal2;TVal1 = value;for (x = 0; x <= 360;x++){TVal2 = sin(dtr(x));if ( TVal1 == TVal2 ) break;}return x;}this basicly gets the Sin^-1 of any angle from 0 to 360 and it wraps the rest to 360 ( there is no more that sin 360 ) but it doesn't work with float angles like 36.6 anybody got any ideas   
  Did you try using asin(), atan2() and acos()?   ;  did u try them , i read about them but there irrelevent i dont kno exactly what they do but they sure dont reverse sin,cos or tan thnx anyway   ;Quote:Original post by Black Acedid u try them , i read about them but there irrelevent i dont kno exactly what they do but they sure dont reverse sin,cos or tan thnx anywayread  herethe first few lines should do...   ;Quote:Original post by Black Acethey sure dont reverse sin,cos or tan thnx anywayYes, they do.   ;  they probably return the result in radians so you need to "rtd" the result// radians to degreesinline double rtd(double rad){  return 180.0*rad/pi;}//testdouble s80 = sin(dtr(80.0));double reverse = rtd(asin(s80));// reverse should be 80.0;  mm i didint notice that they returned in radins k thnx   ;  k solved the problem with my function thnx guysdouble ReverseSin(double value){double x;double TVal1,TVal2;TVal1 = value;for (x = 0; x &lt;= 90;x+= 0.0001){TVal2 = sin(dtr(x));if ( TVal1 - TVal2 &lt; 0.00000001 ) break;}return x;}Sneftel there were really no need to downrate me just because i said something wrong ( i didint know they returned in radiens ) but thats u r choice .   ;  I haven't rated you at all. You know what they say about "assume".   ;Quote:Original post by Black Acek solved the problem with my function thnx guys*** Source Snippet Removed ***Sneftel there were really no need to downrate me just because i said something wrong ( i didint know they returned in radiens ) but thats u r choice .have you tested how long this function takes to return values ( get all the inverse sins from 0 to 360, divide time taken by 360, and see wht you get... )   