title: Calculating a 2D Vector's Cross Product
body: <p>From wikipedia: </p>
  
  <blockquote>
    <p>the cross product is a binary operation on two vectors in a <strong>three-dimensional</strong> Euclidean space that results in another vector which is perpendicular to the plane containing the two input vectors.</p>
  </blockquote>
  
  <p>Given that the definition is only defined in three (<a href="https://en.wikipedia.org/wiki/Seven-dimensional_cross_product#Consequences_of_the_defining_properties" rel="noreferrer">or seven, one and zero</a>) dimensions, how does one calculate the cross product of two 2d vectors?</p>
  
  <p>I have seen two implementations. One returns a new vector (but only accepts a single vector), the other returns a scalar (but is a calculation between two vectors).</p>
  
  <p>Implementation 1 (returns a scalar):</p>
  
  <pre><code>float CrossProduct(const Vector2D &amp; v1, const Vector2D &amp; v2) const
  {
      return (v1.X*v2.Y) - (v1.Y*v2.X);
  }
  </code></pre>
  
  <p>Implementation 2 (returns a vector):</p>
  
  <pre><code>Vector2D CrossProduct(const Vector2D &amp; v) const
  {
      return Vector2D(v.Y, -v.X);
  }
  </code></pre>
  
  <p>Why the varying implementations? What would I use the scalar implementation for? What would I use the vector implementation for?</p>
  
  <p>The reason I ask is because I'm writing a Vector2D class myself and don't know which method to use.</p>