예제 #1
0
 public static float Angle(Vector2 from, Vector2 to)
 {
     return(Mathf.Acos(Mathf.Clamp(Vector2.Dot(from.normalized, to.normalized), -1f, 1f)) * 57.29578f);
 }
예제 #2
0
 public static Vector2 Reflect(Vector2 inDirection, Vector2 inNormal)
 {
     return(-2f * Vector2.Dot(inNormal, inDirection) * inNormal + inDirection);
 }