I have three vectors V1, V2, and V3. Their origin points are on the axes\' origin. How could I determine whether V3 is between V1 and V2 when I move around counterclockwise
To test this condition you have to calculate the winding of two triangles:
The triangle formed by V1, the origin and V3. This triangle must be counter-clockwise.
The triangle formed by V3, the origin and V2. This triangle must be counter-clockwise as well.
To test the winding of a triangle it's enough to check the sign of the 2D cross-product of the vertices.
The test looks like this (sorry - C-code):
int IsBetween (vector v1, vector v2, vector v3)
{
float winding1 = (v1.x * v3.y - v1.y * v3.x);
float winding2 = (v3.x * v2.y - v3.y * v2.x);
// this test could be exactly the wrong way around. This depends
// on how you define your coordinate system (e.g. is Y going up or down?)
if ((winding1 <0) && (winding2 < 0))
{
printf ("V3 is between them\n");
}
else
{
printf ("it's not\n");
}
}