C# Windows Forms. Анимация объекта. Нужно переделать код, чтобы кружок двигался по синусоиде (а не по кругу)

Public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
double a, x, y;
private int x1, y1, x2, y2;
private double t, fi;
private Pen pen = new Pen(Color.DarkRed, 2);
private void Form1_Load(object sender, EventArgs e)
{
a = 0;
x = y = 100;
}
private void Form1_Paint(object sender,
PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawEllipse(pen, Convert.ToInt32(x), Convert.ToInt32(y), 20, 20);
}
private void timer1_Tick(object sender, EventArgs e)
{
x = x + 5 * Math.Sin(a);
y = y + 5 * Math.Sin(a);
a = a + 0.1;
Invalidate();
}
}

X = x + 5 * Math.Sin(a);
y = a;

Добавить комментарий