public static RotateZ ( this v, float angle ) : void | ||
v | this | |
angle | float | |
return | void |
public static void RotateZ(this Vector3 v, float angle)
{
float sin = Mathf.Sin(angle);
float cos = Mathf.Cos(angle);
float tx = v.x;
float ty = v.y;
v.x = (cos * tx) - (sin * ty);
v.y = (cos * ty) + (sin * tx);
}