src/libm/s_atan.c
changeset 8004 13da154af020
parent 6044 35448a5ea044
child 8056 abd9434c5d3e
equal deleted inserted replaced
8003:998458760218 8004:13da154af020
   110 	    z = atanhi[id] - ((x*(s1+s2) - atanlo[id]) - x);
   110 	    z = atanhi[id] - ((x*(s1+s2) - atanlo[id]) - x);
   111 	    return (hx<0)? -z:z;
   111 	    return (hx<0)? -z:z;
   112 	}
   112 	}
   113 }
   113 }
   114 libm_hidden_def(atan)
   114 libm_hidden_def(atan)
       
   115 
       
   116 double SDL_acos(double val)
       
   117 {
       
   118     double result;
       
   119     if (val == -1.0) {
       
   120         result = M_PI;
       
   121     } else {
       
   122         result = SDL_atan(SDL_sqrt(1.0 - val * val) / val);
       
   123         if (result < 0.0)
       
   124         {
       
   125             result += M_PI;
       
   126         }
       
   127     }
       
   128     return result;
       
   129 }
       
   130 
       
   131 double SDL_asin(double val)
       
   132 {
       
   133     double result;
       
   134     if (val == -1.0) {
       
   135         result = -(M_PI / 2.0);
       
   136     } else {
       
   137         result = (M_PI / 2.0) - SDL_acos(val);
       
   138     }
       
   139     return result;
       
   140 }