title: Rotation function weird behaviour
body: <p>I've been working on a rotation function. The points move sligthly to the rotation center with each cycle. It depends on a function to get the distance between the center and the point to rotate:</p>
  
  <pre><code>struct Vector3F
  {
      float x, y, z;
  };
  
  inline float GetDistance3FX_inline(Vector3F* v1, Vector3F* v2) 
  { 
      return v1-&gt;x - v2-&gt;x; 
  }
  
  inline float GetDistance3FZ_inline(Vector3F* v1, Vector3F* v2) 
  { 
      return v1-&gt;z - v2-&gt;z; 
  }
  </code></pre>
  
  <p>The actual rotation function, that <strong>does</strong> work:</p>
  
  <pre><code>void Rotate3FY(Vector3F* point, Vector3F* center, float rad)
  {
      float x = GetDistance3FX_inline(point, center);
      float z = GetDistance3FZ_inline(point, center);
      point-&gt;x = x * cos(rad) - z * sin(rad) + center-&gt;x;
      point-&gt;z = z * cos(rad) + x * sin(rad) + center-&gt;z;
  }
  </code></pre>
  
  <p>The function that <strong>does not</strong> work:</p>
  
  <pre><code>void Rotate3FY(Vector3F* point, Vector3F* center, float rad)
  {
      point-&gt;x = GetDistance3FX_inline(point, center) * cos(rad) - GetDistance3FZ_inline(point, center) * sin(rad) + center-&gt;x;
      point-&gt;z = GetDistance3FZ_inline(point, center) * cos(rad) + GetDistance3FX_inline(point, center) * sin(rad) + center-&gt;z;
  }
  </code></pre>
  
  <p>I have no clue what logical difference there is between these two. 
  Thank your for any advice.</p>