title: What's wrong with this XNA RotateVector2 function?
body: <p>I know this is probably a <em>very</em> simple question, but I can't seem to figure it out. First of all, I want to specify that I did look over Google and SO for half an hour or so without finding the answer to my question(yes, I am serious).</p>
  
  <p>Basically, I want to rotate a Vector2 around a point(which, in my case, is always the (0, 0) vector). So, I tried to make a function to do it with the parameters being the point to rotate and the angle(in degrees) to rotate by.</p>
  
  <p>Here's a quick drawing showing what I'm trying to achieve:</p>
  
  <p><img src="https://i.stack.imgur.com/8RiGa.png" alt="alt text"></p>
  
  <p>I want to take V1(red vector), rotate it by an angle A(blue), to obtain a new vector (V2, green). In this example I used one of the simplest case: V1 on the axis, and a 90 degree angle, but I want the function to handle more "<em>complicated</em>" cases too.</p>
  
  <p>So here's my function:</p>
  
  <pre><code>public static Vector2 RotateVector2(Vector2 point, float degrees)
  {
      return Vector2.Transform(point, 
      Matrix.CreateRotationZ(MathHelper.ToRadians(degrees)));
  }
  </code></pre>
  
  <p>So, what am I doing wrong? When I run the code and call this function with the (0, -1) vector and a 90 degrees angle, I get the vector (1, 4.371139E-08) ...</p>
  
  <p>Also, what if I want to accept a point to rotate around as a parameter too? So that the rotation doesn't always happen around (0, 0)...</p>