Ok I added two functions to the Vector2 class from the game engine. I am trying to take the cross product of vector A with vector B in 2D. After doing the research many said that it can not be done in 2D, but I found this and it makes sense. A<i,j> x B<i,j> = signed Area of Parallelogram created by A & B. Even though this is area, it can have a negative value, we will get to this in a minute. If we compare to 3D vector cross product we know that AxB yeilds a vector C that is orthogonal to both A & B and that the magnitude of C is defined as the Area of the parallelogram of A & B. We see similarities here. The cross in 2D yeilds the same area as the magnitude of C in 3D. The sign represents which direction. I will show the functions below. One function is overloaded which is where I have a question about it.

`// -----------------------------------------------------------------------`

// Cross2Area()

// Return The Cross Product Of Two Vectors In 2D This Represents The

// Signed Area Of The Parellelogram Formed By The Extension Of One

// Vector By Another

inline float Vector2::Cross2Area( Vector2 v2 ) {

return ( _fX*v2._fY - _fY*v2._fX );

} // Cross

// -----------------------------------------------------------------------

// Cross2Vector3()

// This Function Returns A 3D Vector Passing In A Value Where This

// Value Represents The Direction And Magnatiude Of The Z Component

// The X And Y Values Always Equal 0

inline Vector3 Vector2::Cross2Vector3( float fValue ) {

return Vector3( 0.0f, 0.0f, fValue );

} // Cross2Vector3

// -----------------------------------------------------------------------

// Cross2Vector3()

// This Function Returns A 3D Vector Passing In 2 Vector2 And Returning

// A Resultant Vector3

inline Vector3 Vector2::Cross2Vector3( Vector2 v2A, Vector2 v2B ) {

Vector3 v3Result;

v3Result._fX = 0.0f;

v3Result._fY = 0.0f;

v3Result._fZ = v2A.Cross2Area( v2B );

return v3Result;

} // Cross2Vector3

The first function Cross2Area takes in a vector 2 does the cross product on the vector2 you are working with and returns a float. The second function Cross2Vector3 takes in a float and just simply sets that to the z-component and returns a Vector3. The 3rd function Cross2Vector3 takes in two Vector2 sets the X,Y components to the resultant Vector3 to 0 and uses the first function on the two Vector2 passed in to find the direction and magnitude of Z. The question is which of these two overloaded functions is the better choice to use? Or does it depend on the given vs. unknown in that particular problem. Secondly I would apprieate it if someone could verify if the work is correct and these functions work right or are implemented correctly, or show me a more efficient way to implement them thank you. I will be using these extensively in the project im working on.

Would the second overload function be equivalant to doing this.

`// -----------------------------------------------------------------------`

// Cross2Vector3()

// This Function Returns A 3D Vector Passing In 2 Vector2 And Returning

// A Resultant Vector3

inline Vector3 Vector2::Cross2Vector3( Vector2 v2A, Vector2 v2B ) {

Vector3 v3A, v3B, v3Result;

v3A._fX = v2A._fX; v3A._fY = v2A._fY;

v3B._fX = v2B._fX; v3A._fY = v2B._fY;

v3Result = v3A.Cross( v3B );

return v3Result;

} // Cross2Vector3