There is a program that draws a trajectory by the formula. Further, respectively, you need to create a point that will move along this trajectory ... That’s the problem. It seems like you need to operate with a timer, but how it is generally incomprehensible to implement everything.

The program itself:

using System; using System.Drawing; using System.Windows.Forms; namespace WindowsFormsApplication13 { public partial class Form1 : Form { public Trajectory cs; public Form1() { InitializeComponent(); } private void pictureBox1_Click(object sender, EventArgs e) { } private void pictureBox1_Paint(object sender, PaintEventArgs e) { const int count = 50; Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height); Point[] ptf = new Point[count]; pictureBox1.Image = bmp; cs.Drow(Graphics.FromImage(bmp)); cs.dubFScale = (double)trackBar1.Value / (double)(trackBar1.Maximum - trackBar1.Minimum); } private void Form1_Load(object sender, EventArgs e) { trackBar1.Minimum = 0; trackBar1.Maximum = 10; trackBar1.Value = (trackBar1.Minimum + trackBar1.Maximum) / 2; cs = new Trajectory(); cs.cx = pictureBox1.Width / 2; cs.cy = pictureBox1.Width / 2; cs.dubFScale = (double)trackBar1.Value/(double)(trackBar1.Maximum-trackBar1.Minimum); } 

And the trajectory class

  using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; namespace WindowsFormsApplication13 { public class Trajectory { public int cx { get; set; } public int cy { get; set; } public const int count = 50; public int k = 5; public int intFRadius =20; public double dubFScale { get; set; } public void Drow(Graphics g) { Point[] ptf = new Point[count]; double f = 0; for (int i = 0; i < ptf.Length; i = i + 1) { ptf[i].X = (int)(cx + intFRadius * dubFScale* (k - 1) * (Math.Cos(f) + (Math.Cos((k - 1) * f)) / (k - 1))); ptf[i].Y = (int)(cy + intFRadius * dubFScale * (k - 1) * (Math.Sin(f) - (Math.Sin((k - 1) * f)) / (k - 1))); f = f + 2 * Math.PI / count; } g.DrawPolygon(Pens.Black, ptf); g.Dispose(); } } } 

Closed due to the fact that the question is too general for the participants Streletz , D-side , aleksandr barakin , Grundy , Nick Volynkin Jun 3 '16 at 6:27 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

    0