float x = Input.GetAxis("Mouse X") - Oposition.x;
float y = Input.GetAxis("Mouse Y") - Oposition.y;
float tanxy = x / y;
float sinxy = y / (x * x + y * y);
zhongdian = new Vector3(Input.GetAxis("Mouse X"), Input.GetAxis("Mouse Y"), 0);
Debug.DrawLine(Oposition, zhongdian, Color.red);
if (y > 0 && sinxy > Mathf.Sin(Mathf.PI / 4) && sinxy < Mathf.Sin(Mathf.PI * 3 / 4))
{
Debug.Log("上");
}
else if (y < 0 && sinxy < Mathf.Sin(Mathf.PI * 5 / 4) && sinxy > Mathf.Sin(Mathf.PI * 7 / 4))
{
Debug.Log("下");
}
else if (x > 0 && x / y > -1 && x / y < 1)
{
Debug.Log("右");
}
else if (x < 0 && x / y > -1 && x / y < 1)
{
Debug.Log("左");
}