All angles are in radians. Your n is what is called an arc of a circle.
public Vector2 RotateByArc(Vector2 Center, Vector2 A, float arc)
{
float radius = Vector2.Distance(Center, A);
float angle = arc / radius;
Vector2 B = RotateByRadians(Center, A, angle);
return B;
}
public Vector2 RotateByRadians(Vector2 Center, Vector2 A, float angle)
{
Vector2 v = A - Center;
float x = v.x * Mathf.Cos(angle) + v.y * Mathf.Sin(angle);
float y = v.y * Mathf.Cos(angle) - v.x * Mathf.Sin(angle);
Vector2 B = new Vector2(x, y) + Center;
return B;
}
source
share