title: sin & cos funcs without math.h
body: <p>I cannot use the c++ functions <code>sin()</code> and <code>cos()</code> due to certain compiler issues caused by PS3 3.40 SDK. What are the calculations of <code>sin()</code> &amp; <code>cos()</code> so i can use functions without needing <code>math.h</code>?</p>
  
  <p>I have so far came up with these, but they seem to not be functioning correctly?</p>
  
  <pre><code>float sin(float deg) {
      bool neg = false;
      while (deg &gt;= 360) deg = deg - 360;
      while (deg &lt; 0) deg = deg + 360;
      if (deg &gt; 180) {
          deg = deg - 180;
          neg = true;
      }
      float ret = (float)(4*deg*(180-deg))/(40500-(deg*(180-deg)));
      if (neg)return ret*-1;
      return ret;
  }
  
  float cos(float AnglesDeg)
  {
   float AnglesRad = DegreesToRadians(AnglesDeg);
   float Rad = (float)(PI/2.0f)-AnglesRad;
   float ang = RadiansToDegrees(Rad);
      return sin(ang);
  }
  </code></pre>