# Vector2.angle - how do i get if it's CW or CCW ?

is there any way to get angle between 2 vectors where i get N for clockwise -N for counterclockwise? or any other way how to get this info?

Basing on answer to this StackOverflow question, you can also use:

``````private static float GetAngle(Vector2 v1, Vector2 v2)
{
var sign = Mathf.Sign(v1.x * v2.y - v1.y * v2.x);
return Vector2.Angle(v1, v2) * sign;
}
``````

it’s always the smallest angle between the two points so it never returns something bigger than 180degrees.

What you can do is to get a static third point and calculate the angles between the 1st and 3rd point and then 2nd and 3rd point and then compare the values to see the angle between the 1st and 2nd points.

There’s probably a better way, but off the top of my head:

1. Rotate both Vector2s such that the
start vector points up
2. Check if the
x component of the second vector is
greater or smaller than the x
component of the first vector.

This will do it for Vector2s if you leave n as the default

``````public static float AngleSigned(Vector3 v1, Vector3 v2, Vector3 n = default(Vector3))
{
n = n == default(Vector3) ? Vector3.forward : n;
return Mathf.Atan2(Vector3.Dot(n, Vector3.Cross(v1, v2)), Vector3.Dot(v1, v2))*Mathf.Rad2Deg;
}
``````

Now done natively: Unity - Scripting API: Vector3.SignedAngle